Highlighted
forumadmin Absent Member.
Absent Member.
5670 views

Help with script -


Question posted 6/15/09 by scoope
Details:

I have the following script to run a command line. It works fine until I add the parameter "IDNUM". Any idea what I'm doing wrong. This is 2008R2. I don't see an error, but the commandline isn't running (should create an output file). I've tried it with and without the QUOTE's.
Option Explicit
const FLD_RecID = "complaintfileid"
dim cmd1, commandline, ok, IDNum
dim QUOTE
QUOTE = CHR(34)
If Ext.ShellHasProp( "Item" ) Then
SetCMDLine
Else
' There is no current item, so write a message to the event viewer
Call Ext.LogErrorMsg( "TeamScript error: Shell.Item does not exist." )
End If
Sub SetCMDLine ()
'get shell info
ok = Shell.Item.GetFieldValue( FLD_RecID, IDNum )
cmd1 = "c:\tmp\WriteFile1.exe "'
commandline = QUOTE & cmd1 & " " & IDNum & QUOTE
'commandline = cmd1
call ext.loginfomsg("commandline = " & commandline)
ok = Ext.CmdLineWait(commandline)
End Sub

0 Likes
7 Replies
forumadmin Absent Member.
Absent Member.

Re: Help with script -


Comment posted 6/15/09 by mtcarver

what shows up in application event viewer for commandline?

0 Likes
forumadmin Absent Member.
Absent Member.

Re: Help with script -


Comment posted 6/15/09 by scoope

I tried 3 different ways and got:
c:\tmp\WriteFile1.exe 24557

"c:\tmp\WriteFile1.exe 24557"
c:\tmp\WriteFile1.exe "24557"
none worked.

0 Likes
forumadmin Absent Member.
Absent Member.

Re: Help with script -


Comment posted 6/15/09 by Lynn Mattie

Try moving your first QUOTE to just before the IDNum parameter (after the space). Otherwise, it will try to treat the whole string as the name of the executable.

0 Likes
forumadmin Absent Member.
Absent Member.

Re: Help with script -


Comment posted 6/15/09 by mtcarver

2 questions is your post above the contents of the app event viewer in windows?
If yo open a cmd prompt on the same server where TT is and execute "c:\tmp\WriteFile1.exe 24557" what happens?
writefile1.exe would have to exist already in c:\tmp

0 Likes
forumadmin Absent Member.
Absent Member.

Re: Help with script -


Comment posted 6/15/09 by scoope

Yes, this is from the app event viewer. It works fine from the cmd prompt on the server.

0 Likes
forumadmin Absent Member.
Absent Member.

Re: Help with script -


Comment posted 6/15/09 by Lynn Mattie

Maybe try NewTaskWait and see if you have better luck with that?

0 Likes
forumadmin Absent Member.
Absent Member.

Re: Help with script -


Comment posted 6/15/09 by scoope

Thanks Lynn. I'll give these a try soon. The server is down right now. 😞

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.