Page 1 of 1 1
Topic Options
#121958 - 2004-06-29 02:05 PM Getting NTBACKUP to run from a kix script.
Stiffmeister Offline
Lurker

Registered: 2004-06-29
Posts: 3
Loc: Roden, the Netherlands
I am trying to get ntbackup to run from a kix script. There seems to be a problem with my command line because it contains quotes (") This is how it looks like:

[code]
:startcopy

IF EXIST ("\\SVRBACKUP2\$SHAREVAR\$SHAREVAR.TXT")
shell "C:\WINDOWS\system32\ntbackup.exe backup "@D:\backup\script.bks" /n "computerstate" /d "computerstate" /n "computerstate" /v:yes /r:no /rs:no /hc:off /m copy /j "backup" /l:s /f "d:\backup\%computername%systemstate.bkf"

ENDIF
[/code]

The first part of this code works. The system starts NTBACKUP. But the options won't load. I have tried putting the options into a new variable and the putting the variable behind the ntbackup.exe part but this creates the same problem. Is there anyone who knows how to solve this problem?

Top
#121959 - 2004-06-29 02:48 PM Re: Getting NTBACKUP to run from a kix script.
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
You need to have an equal amounts of quotes..

Code:

$backupsw=' /n "computerstate" /d "computerstate" /n "computerstate" /v:yes /r:no /rs:no '
$backupsw=$backupsw+'/hc:off /m copy /j "backup" /l:s /f "d:\backup\'+@wksta+'systemstate.bkf"
IF EXIST ("\\SVRBACKUP2\"+$SHAREVAR+"\"+$SHAREVAR+".TXT")
shell '"C:\WINDOWS\system32\ntbackup.exe backup @@D:\backup\script.bks"'+$backupsw
ENDIF



Also, if you use $ and @ in your script, they need to be either segregated out or doubled up.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#121960 - 2004-06-30 04:48 AM Re: Getting NTBACKUP to run from a kix script.
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Additionally, there are a couple of helpful FAQs in the FAQ Forum.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.056 seconds in which 0.029 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org