Mechanism to get STRING for DESTOP using PREMIER . . .
All --
I would like to set a STRING VARIABLE to the PATH to the desktop within a PREMIER AUTOMATION.
The closest thing that I can find within the MACRO SCRIPTING HELP is the
Environ Function
in the
Miscellaneous Group
The example code that I created for this does not work.
Here is the code:
-------------------------
Here is the output to the debug window:
-------------------------
Hi from X1
s
Hi from X2
s
ALLUSERSPROFILE=C:\ProgramData
s
APPDATA=C:\Users\Matt\AppData\Roaming
-------------------------
Here is the results from a SET command given within a CMD window:
-------------------------
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Matt\AppData\Roaming
asl.log=Destination=file
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=MMB-VAIO-201304
ComSpec=C:\Windows\system32\cmd.exe
configsetroot=C:\Windows\ConfigSetRoot
ExtraPuTTY=C:\Program Files\ExtraPuTTY\Bin
ExtraPuTTY_BOXSIZE=AUTO
ExtraPuTTY_MODE=DIR_MODE
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Matt
LOCALAPPDATA=C:\Users\Matt\AppData\Local
LOGONSERVER=\\MMB-VAIO-201304
NUMBER_OF_PROCESSORS=8
OS=Windows_NT
Path=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Outlook Express;C:\Program Files (x86)\Windows Live\Shared;c:\batfiles\;C:\LEADCMD;C:\LEADCMD\Bin;C:\Program Files\MATLAB\R2013b\bin;C:\Program Files (x86)\QuickTime\QTSystem\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3a09
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\Matt\AppData\Local\Temp
TMP=C:\Users\Matt\AppData\Local\Temp
USERDOMAIN=MMB-VAIO-201304
USERNAME=Matt
USERPROFILE=C:\Users\Matt
windir=C:\Windows
windows_tracing_flags=3
windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log
-------------------------
I could fiddle around and find the number that corresponds with the
HOMEDRIVE=C:
HOMEPATH=\Users\Matt
on my computer and then add the DESKTOP to that but I'm afraid that on the user's computer, the number of items on the SET LIST would be different.
The INTERNET suggest using
Is there a solution to this?
Thanks.
-- Matt
I would like to set a STRING VARIABLE to the PATH to the desktop within a PREMIER AUTOMATION.
The closest thing that I can find within the MACRO SCRIPTING HELP is the
Environ Function
in the
Miscellaneous Group
The example code that I created for this does not work.
Here is the code:
-------------------------
Public Sub x1 Debug.Print "Hi from X1" Dim s As String s = Environ("PATH") Debug.Print "s" Debug.Print s End Sub Public Sub x2 Debug.Print "Hi from X2" Dim s As String s = Environ(1) Debug.Print "s" Debug.Print s s = Environ(2) Debug.Print "s" Debug.Print s End Sub-------------------------
Here is the output to the debug window:
-------------------------
Hi from X1
s
Hi from X2
s
ALLUSERSPROFILE=C:\ProgramData
s
APPDATA=C:\Users\Matt\AppData\Roaming
-------------------------
Here is the results from a SET command given within a CMD window:
-------------------------
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Matt\AppData\Roaming
asl.log=Destination=file
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=MMB-VAIO-201304
ComSpec=C:\Windows\system32\cmd.exe
configsetroot=C:\Windows\ConfigSetRoot
ExtraPuTTY=C:\Program Files\ExtraPuTTY\Bin
ExtraPuTTY_BOXSIZE=AUTO
ExtraPuTTY_MODE=DIR_MODE
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Matt
LOCALAPPDATA=C:\Users\Matt\AppData\Local
LOGONSERVER=\\MMB-VAIO-201304
NUMBER_OF_PROCESSORS=8
OS=Windows_NT
Path=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Outlook Express;C:\Program Files (x86)\Windows Live\Shared;c:\batfiles\;C:\LEADCMD;C:\LEADCMD\Bin;C:\Program Files\MATLAB\R2013b\bin;C:\Program Files (x86)\QuickTime\QTSystem\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3a09
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\Matt\AppData\Local\Temp
TMP=C:\Users\Matt\AppData\Local\Temp
USERDOMAIN=MMB-VAIO-201304
USERNAME=Matt
USERPROFILE=C:\Users\Matt
windir=C:\Windows
windows_tracing_flags=3
windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log
-------------------------
I could fiddle around and find the number that corresponds with the
HOMEDRIVE=C:
HOMEPATH=\Users\Matt
on my computer and then add the DESKTOP to that but I'm afraid that on the user's computer, the number of items on the SET LIST would be different.
The INTERNET suggest using
but neither one of these seems to work within premier<span class="pln">or<br></span>
<span class="pln"></span><span class="kwd"><br>Dim</span><span class="pln"> s </span><span class="kwd">As</span><span class="pln"> </span><span class="kwd">String</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> Environment</span><span class="pun">.</span><span class="pln">GetFolderPath</span><span class="pun">(</span><span class="pln">Environment</span><span class="pun">.</span><span class="pln">SpecialFolder</span><span class="pun">.</span><span class="pln">Desktop</span><span class="pun">)</span>
<span class="kwd">Dim</span><span class="pln"> desktopPath </span><span class="pun">=</span><span class="pln"> My</span><span class="pun">.</span><span class="pln">Computer</span><span class="pun">.</span><span class="pln">FileSystem</span><span class="pun">.</span><span class="pln">SpecialDirectories</span><span class="pun">.</span><span class="pln">Desktop<br><br></span>
Is there a solution to this?
Thanks.
-- Matt
0
Best Answer
-
Matt,You can use this:
Sub ShowDesktop MsgBox (system.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop)) End Sub
Pierre0
Answers
Thank your your quick response.
That works perfectly.
Thanks again.
-- Matt