In DOS, I can pass parameter as %username% onto a DOS script, for example
cd "d:\users\%username%\abc\def"
and the script would pass the actual username (ie, john, michael) as a replacement for %username% when it run.
In WinBatch, I run the following command
DirChange (d:\users\%username%\abc\def) and Winbatch would not recognize %username%
How can I resolve this issue??
thx
Take a look at the Environment() function.
Jim
Quote from: mtruong1 on September 22, 2014, 07:59:33 AM
In DOS, I can pass parameter as %username% onto a DOS script, for example
cd "d:\users\%username%\abc\def"
and the script would pass the actual username (ie, john, michael) as a replacement for %username% when it run.
In WinBatch, I run the following command
DirChange (d:\users\%username%\abc\def) and Winbatch would not recognize %username%
How can I resolve this issue??
thx
username = Environment('username')
DirChange ('d:\users\%username%\abc\def')