StarDusterII
asked on
task created with schtasks is using the wrong current directory
I'm creating a scheduled task within a .vbs that creates the task using:
But when I run the task, it thinks the current directory is c:\windows\system32. I have an .ini file in the same directory as .vbs (d:\data) that it can't find. How to I get the task scheduler to use the same directory as the target of the action?
schtasks /create /tn Eterna /tr "d:\data\eterna.vbs /sc WEEKLY /d MON,TUE,WED,THU,FRI /st 08:00:00
But when I run the task, it thinks the current directory is c:\windows\system32. I have an .ini file in the same directory as .vbs (d:\data) that it can't find. How to I get the task scheduler to use the same directory as the target of the action?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Interesting... I used:
CurrentDirectory = fso.GetAbsolutePathName(".")
Similar idea, but I'll give yours a go.
ASKER
Perfect! Thanks a ton.
ASKER