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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ntbackup and dir names

Status
Not open for further replies.

sc7090

Technical User
Oct 28, 2003
21
IT
i'm trying to backup file with this command:

ntbackup backup D:\Program Files\dir1\dir2 etc...

but it doesn't work. So i wrote:

ntbackup backup D:\Progra~1\dir1\dir2 etc...

it works, but if i call it from a VBScript it doesn't. Any idea?

Thanks.
 
Show the actual line of code that you are using to call it.

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
And what about something like this ?
cmd="ntbackup backup ""D:\Program Files\dir1\dir2"" etc ..."
Set sh = CreateObject("WSCript.Shell")
sh.Run cmd
If you want the script wait for completion, try this:
rc = sh.Run(cmd, 1, True)

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yeah, You did it!
It works, but it's better to write:

cmd = "cmd /c ntbackup backup ""D:\Program Files\dir1\dir2"" etc ..."

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top