2

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.

2
  • 1
    What's trueimagecmd? Is that application available when running under the other user's account? Does it require administrative privileges? Commented May 7, 2011 at 8:15
  • Is E: a network drive? If so, it's probably not mapped for the account that is not working. Commented May 9, 2011 at 14:47

2 Answers 2

1

Have you tried calling trueimagecmd with the full path to the executable? For instance C:\progra~1\trueimage\trueimagecmd.exe

Sign up to request clarification or add additional context in comments.

1 Comment

Hi ariel, sorry I've been busy this weekend and haven't had a chance to work on this. I'll try your suggestion tomorrow and post an update ASAP. Thanks.
0

Make sure you have drive E in the other machine from where it generates error. Try using c:\backups\autoBackup_" & dString &".tib" instead of e:\backups\autoBackup" & dString &"_.tib"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.