Page 1 of 1 1
Topic Options
#139404 - 2005-05-09 10:09 AM Should a grown man cry at a kix script ??? HELP
Brant_Winter Offline
Fresh Scripter

Registered: 2005-05-08
Posts: 26
OK This is getting ridiculous, I am still having problems with formatting a SHELL command. I am trying to pipe output of an .exe file to a text file. Problem is Symantec Livestate Recovery requires it's command files to include FULL paths.

Even the piped output path needs to be a full path.

This code works:
Code:

SetOption("WrapAtEOL","ON")
$LSPath = "C:\Program Files\Symantec\LiveState Recovery\Advanced Server 3.0\Agent\CommandFiles\"
$g='%COMSPEC% /C "' + $LSPath + 'pslist.exe" > pslist.txt'
? $g
SHELL $g



This does not:

Code:

SetOption("WrapAtEOL","ON")
$LSPath = "C:\Program Files\Symantec\LiveState Recovery\Advanced Server 3.0\Agent\CommandFiles\"
$g='%COMSPEC% /C "' + $LSPath + 'pslist.exe" > "'+$LSPATH+'pslist.txt"'
? $g
SHELL $g



I get this damm message saying:
Code:

C:\Program' is not recognized as an internal or external command,
operable program or batch file.



Can someone please help me ??

Top
#139405 - 2005-05-09 12:08 PM Re: Should a grown man cry at a kix script ??? HELP
jifop Offline
Fresh Scripter

Registered: 2004-12-21
Posts: 17
Loc: England
possibly

$LSPath = "C:\Program Files\Symantec\LiveState Recovery\Advanced Server 3.0\Agent\CommandFiles\"

should be

$LSPath = 'C:\Program Files\Symantec\LiveState Recovery\Advanced Server 3.0\Agent\CommandFiles\'

maybe


Edited by jifop (2005-05-09 12:09 PM)

Top
#139406 - 2005-05-09 12:54 PM Re: Should a grown man cry at a kix script ??? HELP
Brant_Winter Offline
Fresh Scripter

Registered: 2005-05-08
Posts: 26
Nope - Same error....
Top
#139407 - 2005-05-09 01:55 PM Re: Should a grown man cry at a kix script ??? HELP
Brant_Winter Offline
Fresh Scripter

Registered: 2005-05-08
Posts: 26
Can anyone help me ? I am running out of time to get this working and I dont want to go back to a batch file !
Top
#139408 - 2005-05-09 02:13 PM Re: Should a grown man cry at a kix script ??? HELP
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Untested but try this:

$g = '%COMSPEC% /C ""' + $LSPath + 'pslist.exe" >"' + $LSPATH + 'pslist.txt""'

-Shawn

Top
#139409 - 2005-05-09 02:18 PM Re: Should a grown man cry at a kix script ??? HELP
Brant_Winter Offline
Fresh Scripter

Registered: 2005-05-08
Posts: 26
you are a genius - that sounds pretty lame, but seriously - i have spent all afternoon trying to get that combination of quotes and single quotes.

I mean i did try before posting, and i went back to the code you supplied me last night, and still could not piece it together.

Humbly - thanks again.

Top
#139410 - 2005-05-09 02:21 PM Re: Should a grown man cry at a kix script ??? HELP
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Glad we could help - don't feel bad about spending much time - that was a very tricky piece of code, even for us old-timers.
Top
#139411 - 2005-05-09 02:30 PM Re: Should a grown man cry at a kix script ??? HELP
Brant_Winter Offline
Fresh Scripter

Registered: 2005-05-08
Posts: 26
hehehe - i feel i BIT better now thanks again - it all works a treat.

I decided to rewrite a clucky batch file to use with Symantec Livestate Recovery - Server imaging s/w. Servers also run CA's High Availability clustering s/w, and I had to do some checks based on which was the production server, what processes are running, etc etc. Then shut down databses services on both servers and also comms agents on remote servers each night to run the images.

Kix is doing it nicely now !

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
0 registered and 1471 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.061 seconds in which 0.027 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