list of file/path references?
Moderators: Dorian (MJT support), JRL
list of file/path references?
I am trying to create and write to files; however, if the exact path of the user,s folders are not known is there a list of references to path names such as %TEMP_DIR%?
I can't find it in help or google.
I can't find it in help or google.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Click Start, then Run and type CMD.EXE
A "DOS" box will appear.
Now type:
SET
Hit enter.
Not actually DOS. SET is still a command, even in Vista, which does not use DOS. We often use the word DOS to describe the command line interface, though it is not really DOS any more.
A "DOS" box will appear.
Now type:
SET
Hit enter.
Not actually DOS. SET is still a command, even in Vista, which does not use DOS. We often use the word DOS to describe the command line interface, though it is not really DOS any more.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Very nice! Thank you both!
Edit...Ok it isn't working.
I know I can writeln> to %TEMP_DIR% using Macro Scheduler; however, when looking at the DOS SET using the cmd.exe prompt and SET command, "TEMP_DIR" isn't listed. TEMP is listed but not the Macro Scheduler's understood TEMP_DIR.
I am trying to writeln to a file on the desktop. But the following isn't working:
WRITEln>%USERPROFILE_DIR%\desktop\junkfile.txt,r,successfully wrote to file
NOR
WRITEln>%USERPROFILE%\desktop\junkfile.txt,r,successfully wrote to file
I found this while searching in Forums:
wln>C:\Documents and Settings\%USER_NAME%\Desktop\
It isn't listed as such in the DOS SET. USER_NAME is listed as USERNAME in the DOS SET.
Edit...Ok it isn't working.
I know I can writeln> to %TEMP_DIR% using Macro Scheduler; however, when looking at the DOS SET using the cmd.exe prompt and SET command, "TEMP_DIR" isn't listed. TEMP is listed but not the Macro Scheduler's understood TEMP_DIR.
I am trying to writeln to a file on the desktop. But the following isn't working:
WRITEln>%USERPROFILE_DIR%\desktop\junkfile.txt,r,successfully wrote to file
NOR
WRITEln>%USERPROFILE%\desktop\junkfile.txt,r,successfully wrote to file
I found this while searching in Forums:
wln>C:\Documents and Settings\%USER_NAME%\Desktop\
It isn't listed as such in the DOS SET. USER_NAME is listed as USERNAME in the DOS SET.
Last edited by Snickers on Fri Aug 17, 2007 2:09 pm, edited 1 time in total.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
TEMP_DIR is a *Macro Scheduler* variable. It stores the location of the Windows temporary folder.
TEMP is a Windows/DOS environment variable which stores the location of the Windows temporary folder.
Therefore they should always contain the same value. But they are not the same thing.
To see Windows Environment Variables go to Control Panel/System/Advanced/Environment Variables
TEMP is a Windows/DOS environment variable which stores the location of the Windows temporary folder.
Therefore they should always contain the same value. But they are not the same thing.
To see Windows Environment Variables go to Control Panel/System/Advanced/Environment Variables
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Maybe you should explain what you are trying to do. If you want a list of Macro Scheduler system variables look in the help file under Command Reference/Variables/System Variables.
Several relate to various important paths:
TEMP_DIR = temporary folder
WIN_DIR = Windows folder
SYS_DIR = Windows System folder
SCRIPT_DIR = Folder containing currently running script (SELF)
This script returns the User's "My Documents" folder:
Several relate to various important paths:
TEMP_DIR = temporary folder
WIN_DIR = Windows folder
SYS_DIR = Windows System folder
SCRIPT_DIR = Folder containing currently running script (SELF)
This script returns the User's "My Documents" folder:
Code: Select all
VBSTART
VBEND
Let>Path=
Let>Path_SIZE=260
LibFunc>shell32.dll,SHGetSpecialFolderPathA,bres,0,Path,5,0
//The return string is "Null Terminated". So find the end by looking for a null char - chr(0)
VBEval>chr(0),NullChar
Pos>NullChar,BRES_2,1,pNull
Let>pNull=pNull-1
//Extract to the null char
MidStr>BRES_2,1,pNull,DocFolder
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
So far I have found out that Macro Scheduler understands %USER_NAME% and %TEMP_DIR%. TEMP is found under my environmental variables but TEMP_DIR and USER_NAME are not. USERNAME is found in DOS SET but USER_NAME is not.
Is there a list showing all Macro Scheduler understood pathing variables such as %USER_NAME% and %TEMP_DIR%?
Is there a list showing all Macro Scheduler understood pathing variables such as %USER_NAME% and %TEMP_DIR%?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Me_again wrote:Let>desktop=C:\Documents and Settings\%USER_NAME%\Desktop
MDL>%desktop%
The trick would be how to know that it's on C: :?
Code: Select all
VBSTART
VBEND
Let>Path=
Let>Path_SIZE=260
LibFunc>shell32.dll,SHGetSpecialFolderPathA,bres,0,Path,5,0
//The return string is "Null Terminated". So find the end by looking for a null char - chr(0)
VBEval>chr(0),NullChar
Pos>NullChar,BRES_2,1,pNull
Let>pNull=pNull-1
//Extract to the null char
MidStr>BRES_2,1,pNull,DocFolder
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?