I'm working on a script that will run as a scheduled task under a local admin account. The heart of the script is as follows:
'Calculate date time
dtm = Now
ymd = (Year(dtm)*10000) + (Month(dtm)*100) + Day(dtm)
hms = (Hour(dtm)*10000) + (Minute(dtm)*100) + Second(dtm)
dString = ymd & "_" & hms
Set Wso = CreateObject("WScript.Shell")
'Write random string to text file for reference by incremental script
Const ForWriting = 2
Set objFile = Fso.OpenTextFile("e:\backups\dString.txt", ForWriting, True)
objFile.WriteLine(dString)
objFile.Close
'Append random string to make full backup name unique'
'Execute full backup creation'
'PROBLEM: Below line will only execute under my domain account
Wso.Run("trueimagecmd /create /filename:""e:\backups\autoBackup_" & dString &"_.tib"" /compression:5 /incremental /partition:""C""")
The above snippet will run fine under my domain account, but will error on the line indicated above with the following:
The system cannot find the file specified
Code: 80070002
Source (null)
This error will not occur when I run it under my account. I'm not familiar enough with the permissions required to run an instance of "Wscript.Shell". Any insight is appreciated.
UPDATE:
trueImagecmd is a command line version of Acronis recovery software. I'm using this script as a way of automating the process for deployment. The command is fine and I can run this script as myself, when running under the local admin account, however, the script executes up to the point indicated, the run command is throwing the error.
UPDATE 2:
Looks like including the full path fixed the problem. Thanks all for your suggestions.
trueimagecmd? Is that application available when running under the other user's account? Does it require administrative privileges?E:a network drive? If so, it's probably not mapped for the account that is not working.