Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell object's run property with NTBackup.

Status
Not open for further replies.

Bretto

Technical User
Oct 17, 2001
59
AU
I am having problems with the following code?

set WshShell = CreateObject("Wscript.Shell")
WshShell.run "ntbackup backup " & "'@c:\DoobieBkUp.bks' " & "/n " & date() & " " & time() & " /d 'DOOBIE Normal BackUp' /v:yes /r:no /rs:no /hc:eek:ff /m normal /j 'DoobieBkUp' /l:s /f 'D:\Doobie_Normal_Daily_BkUp'"

Its batch file equivalent following works perfectly, however I am only a newbie to vbscript can anyone help???

C:\WINNT\system32\ntbackup.exe backup "@C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\DoobieBkUp.bks" /n "%date% %time%" /d "DOOBIE Normal BackUp" /v:yes /r:no /rs:no /hc:eek:ff /m normal /j "DoobieBkUp" /l:s /f "D:\Doobie_Normal_Daily_BkUp"


I want to change all my batch files to vbscript, up until now I haven't had too many issues but this does not make sense.

Just Trying to learn,
Cheers,
Bretto
 
What is the exact problem with your VBS script ?
The .run command you try to execute is not the the same as the .bat file...

Hope This Help
PH.
 
NTBackup gives me a the error

<-Invalid Command Line Parramater &quot;@c:\DoobieBkUp.bks&quot;->

Same Parameter works fine with a batch file.
 
In the batch file the parameter are not the same...
Try this:
Code:
WshShell.run &quot;ntbackup backup &quot; & Chr(34) & &quot;@C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\DoobieBkUp.bks&quot; & Chr(34) & &quot; /n &quot; & date() & &quot; &quot; & time() & &quot; /d &quot; & Chr(34) & &quot;DOOBIE Normal BackUp&quot; & Chr(34) & &quot; /v:yes /r:no /rs:no /hc:off /m normal /j DoobieBkUp /l:s /f &quot; & Chr(34) &&quot;D:\Doobie_Normal_Daily_BkUp&quot; & Chr(34)


Hope This Help
PH.
 
Chr() returns an ASCII Character, Yes?

Thanks for your Help I have it working but still had to make a few Mods, Here it is.

set wshShell = CreateObject(&quot;Wscript.Shell&quot;)
WshShell.run &quot;ntbackup backup &quot; & Chr(34) & &quot;@C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\DoobieBkUp.bks&quot; & Chr(34) & &quot; /n &quot; & chr(34) & date() & chr(32) & time() & Chr(34) & &quot; /d &quot; & Chr(34) & &quot;DOOBIE Normal BackUp&quot; & Chr(34) & &quot; /v:yes /r:no /rs:no /hc:eek:ff /m normal /j DoobieBkUp /l:s /f &quot; & Chr(34) &&quot;D:\Doobie_Normal_Daily_BkUp&quot; & Chr(34)


You Are a Legend Thankyou.
 
Chr(34) returns the double quote character

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top