Server running 2003R2.
I have a script, which basically sets a variable, which then uses it to name a backup file. I have given the exact script here:
echo > "%temp%\tmp.vbs" wscript.echo 10000 * month(now()) ^
+ 100 * day(now()) + year(now())-2000
for /F %%a in ('cscript //nologo "%temp%\tmp.vbs"') do (
set MyDate = %%a)
echo %MyDate% >test.txt
This script is run from Scheduled Task. When I run the task under my login, and run it as myself, it runs perfectly. However, if I run the task as Domain Administrator, or some other "Backup" user, the set command on the given above does not work.
I have put the last echo command for test purpose.
When it works, it gives me the actual value of MyDate. When not, it just ignores the value, as if it was not even there. I get "Echo is off" command, as if the command was Echo only...
Just cannot understand why it runs under some users, and not under some users.
And insight, and enlightenment would help.
Thanks.