Page 1 of 1 1
Topic Options
#155182 - 2006-01-12 10:44 PM Shell
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
I'm having issues with trying to shell out to HP's integrated log viewer.

Here is the shell statement:

Code:


Shell "%COMSPEC% /c '$program' /export:$TMPFILE /f:$bugfile"



This is what the variables represent:

Code:
 
Shell "%comspec% /c 'c:\Program Files\Compaq\Cpqimlv\cpqimlv.exe' /export:C:\Program Files\Quest Software\Big Brother\BBNT\3.01\tmp\tmp.txt /f:C:\Program Files\Quest Software\Big Brother\BBNT\3.01\tmp\tmp1.txt"



I'm getting an "incorrect function" error when executing. I've tried changing the input in all manner of ways and haven't had any luck as of yet. Any suggestions?
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#155183 - 2006-01-12 10:47 PM Re: Shell
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
Shell '%COMSPEC% /c "'+$program+'" /export:"'+$TMPFILE+'" /f:$bugfile'


basically, you have to watch for long file names and have them quoted properly
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#155184 - 2006-01-12 11:20 PM Re: Shell
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
I was sure that it was the long directory path, and thanks for the tip, but that gets me the same error. I'll keep trying variations...surely I'll hit the right format sooner or later.
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#155185 - 2006-01-12 11:29 PM Re: Shell
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Try adding

Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')


Then instead of using SHELL just use the newline ?
on DOS console so you can see the output that the program should be seeing.
 

Top
#155186 - 2006-01-13 12:13 AM Re: Shell
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Assuming the parms are correct, it should go like this:

$c = 'c:\Program Files\Compaq\Cpqimlv\cpqimlv.exe'
$e = 'C:\Program Files\Quest Software\Big Brother\BBNT\3.01\tmp\tmp.txt'
$f = 'C:\Program Files\Quest Software\Big Brother\BBNT\3.01\tmp\tmp1.txt'

Shell '%comspec% /c "'+$c+'" /export:"+$e+'" /f:"'+$f+'"'
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#155187 - 2006-01-13 06:01 AM Re: Shell
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja, boys didn't correct the $f quoting.
_________________________
!

download KiXnet

Top
#155188 - 2006-01-13 04:27 PM Re: Shell
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
If I use this:
Code:
 
$c = 'c:\Program Files\Compaq\Cpqimlv\cpqimlv.exe'
$e = 'C:\Program Files\Quest Software\Big Brother\BBNT\3.01\tmp\tmp.txt'
$f = 'C:\Program Files\Quest Software\Big Brother\BBNT\3.01\tmp\tmp1.txt'
$g = 'server1'

Shell '%comspec% /c "'+$c+'" /m:"'+$g+'" /export:"'+$e+'" /f:"'+$f+'"'



I get an error that indicates the cmd interpreter can't see the complete command because of the space between "program".

I redirected the output to a file, cut and pasted the output at the command line and it worked fine. Any ideas?
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#155189 - 2006-01-13 04:29 PM Re: Shell
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Try:
Code:
Shell '"'+%comspec%+'" /c "'+$c+'" /m:"'+$g+'" /export:"'+$e+'" /f:"'+$f+'"'


Top
#155190 - 2006-01-13 04:49 PM Re: Shell
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
This is the output from that change

Quote:


"C:\WINDOWS\system32\cmd.exe" /c "c:\Program Files\Compaq\Cpqimlv\cpqimlv.exe" /m:"server1" /export:"C:\Program Files\Quest Software\Big Brother\BBNT\3.01\tmp\tmp.txt" /f:"C:\Program Files\Quest Software\Big Brother\BBNT\3.01\tmp\tmp1.txt"


_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#155191 - 2006-01-13 05:03 PM Re: Shell
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
And you are still getting the error?

What is the error, and how is it displayed?

Top
#155192 - 2006-01-13 05:05 PM Re: Shell
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
don't need the quotes around comspec or $g

CMD freaks if there are too many quotes on a cmd line
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#155193 - 2006-01-13 05:20 PM Re: Shell
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Maybe there are mismatched quotes elsewhere in the script. Try creating a new scriptlet with just the bare necessities.
If that doesn't do it, it could be that the app is sensitive to the current dir which would be different in a DOS box vs. the script.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#155194 - 2006-01-13 05:29 PM Re: Shell
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
This is the output:

Quote:


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


_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#155195 - 2006-01-13 05:45 PM Re: Shell
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
This works:

Quote:


Shell '"'+$c+'" /m:$g /export:"'+$e+'" /f:"'+$f+'"'





Les, I am using just the basic script suggested earlier. Not sure why omitting %comspec% would cause it to work. I must have a syntax problem still.
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#155196 - 2006-01-13 05:50 PM Re: Shell
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what is the default maxlen of commandline?
_________________________
!

download KiXnet

Top
#155197 - 2006-01-13 09:36 PM Re: Shell
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Well I won't butt in here since most the big guns are already giving advice, but I'll add a URL to the application in case anyone wants more information on it.


Compaq Integrated Management Log
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=563609

 

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 895 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.035 seconds in which 0.013 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