SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Using "Run" command in JAL script

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Using "Run" command in JAL script
Author Message
Karen



Joined: 20 Dec 2004
Posts: 20

Post Using "Run" command in JAL script Reply with quote

using a "run" command to execute a DOS command line function for
PKZIP. The command zips and encrypts specific files.
The command does work at the DOS level...

Upon executing via scheduler (JAL script) receive the
following error:

Create process failed
Return Code 2-The system cannot find the file specified

Thu Jan 13, 2005 11:40 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Using "Run" command in JAL script Reply with quote

Do you have spaces in path or file names? If yes did you enclose these names in double quotes as required by DOS/Windows?
Did you use "\\" or "\" in file path names? Please check "Special see ASCII characters topic" in the on-line help for more details.

: using a "run" command to execute a DOS command line function for
: PKZIP. The command zips and encrypts specific files.
: The command does work at the DOS level...

: Upon executing via scheduler (JAL script) receive the
: following error: Create process failed
: Return Code 2-The system cannot find the file specified

Thu Jan 13, 2005 12:01 pm View user's profile Send private message
Karen



Joined: 20 Dec 2004
Posts: 20

Post Re: Using "Run" command in JAL script Reply with quote

Yes, I've used the params and included "\\" or "\".
Is there an alternative to using "Run"? Must I create
a batch file to kick off the DOS command?

: using a "run" command to execute a DOS command line function for
: PKZIP. The command zips and encrypts specific files.
: The command does work at the DOS level...

: Upon executing via scheduler (JAL script) receive the
: following error: Create process failed
: Return Code 2-The system cannot find the file specified

Thu Jan 13, 2005 12:51 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Using "Run" command in JAL script Reply with quote

You don't need a batch file, just enter the command correctly.
Please post the complete script here (you can replace the actual password with something else) so I can verify how you entered the pkzip command.

: Yes, I've used the params and included "\\" or "\".
: Is there an alternative to using "Run"? Must I create
: a batch file to kick off the DOS command?

Thu Jan 13, 2005 1:14 pm View user's profile Send private message
Karen



Joined: 20 Dec 2004
Posts: 20

Post Re: Using "Run" command in JAL script Reply with quote

: You don't need a batch file, just enter the command correctly.
: Please post the complete script here (you can replace the actual password
: with something else) so I can verify how you entered the pkzip command.

here you are....
Dim today, date
Dim yesterday, date
Dim file_namea, string
Dim file_nameb, string
Dim file_fdate, string
Dim z_filename, string
dim process, number

// Get todays's date
Today( today )
// Calculate yesterday's date
DateAdd( today, -1, yesterday )
// convert to string in mmdd format
Format( yesterday,"mmdd", file_fdate)
// Append file extension
Concat "fodh", file_fdate, file_namea
Concat file_namea,".dem", file_namea
Concat "i:\\aps\\",file_namea,file_namea
Concat "fodh", file_fdate, file_nameb
Concat file_nameb,".chg", file_nameb
Concat "i:\\aps\\",file_nameb,file_nameb
Concat "fodh", file_fdate, z_filename
Concat z_filename,".zip", z_filename
Concat "i:\\aps\\",z_filename,z_filename

// Run the zip,encrypt command

Run("i:\\aps\\pkzipc -add -password=password -cryptalgorithm=rc4,128 z_filename file_namea file_nameb","i:\\aps",process)

Thu Jan 13, 2005 1:48 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Using "Run" command in JAL script Reply with quote

You are not passing the correct command. Don't expect 24x7 to figure out that in
"i:\\aps\\pkzipc -add -password=password -cryptalgorithm=rc4,128 z_filename file_namea file_nameb" line text z_filename file_namea file_nameb are variables and not just literals which are part of the command line.

Here is what you need to do to fix your version of the script:

Dim command, string
ConcatEx "i:\\aps\\pkzipc -add -password=password -cryptalgorithm=rc4,128 ", z_filename, " ", file_namea, " ", file_nameb, command
Run command, "i:\\aps", process

This assumes that all referenced files are located in c:\apps because no other file path is given.

** Here is another tip. You can greatly simply this script if you use "@" macros. You can even convert this job to a program type job. Here is how

////////////
Dim file_namea, string, "fodh@DP"mmdd".dem"
Dim file_nameb, string, "fodh@DP"mmdd".chg"
Dim file_nameb, string, "fodh@DP"mmdd".zip"
////////////

** To make it a 2-line job, do
Dim process, number
Run "i:\\aps\\pkzipc -add -password=password -cryptalgorithm=rc4,128 fodh@DP"mmdd".zip fodh@DP"mmdd".dem "fodh@DP"mmdd".cfg", "i:\\aps",process)

** To convert it to a program type job copy the command part from Run to the job command line replacing \\ with single \

Hope this helps.

: here you are....
: Dim today, date
: Dim yesterday, date
: Dim file_namea, string
: Dim file_nameb, string
: Dim file_fdate, string
: Dim z_filename, string
: dim process, number

: // Get todays's date
: Today( today )
: // Calculate yesterday's date
: DateAdd( today, -1, yesterday )
: // convert to string in mmdd format
: Format( yesterday,"mmdd", file_fdate)
: // Append file extension
: Concat "fodh", file_fdate, file_namea
: Concat file_namea,".dem", file_namea
: Concat "i:\\aps\\",file_namea,file_namea
: Concat "fodh", file_fdate, file_nameb
: Concat file_nameb,".chg", file_nameb
: Concat "i:\\aps\\",file_nameb,file_nameb
: Concat "fodh", file_fdate, z_filename
: Concat z_filename,".zip", z_filename
: Concat "i:\\aps\\",z_filename,z_filename

: // Run the zip,encrypt command

: Run("i:\\aps\\pkzipc -add -password=password -cryptalgorithm=rc4,128
: z_filename file_namea file_nameb","i:\\aps",process)

Thu Jan 13, 2005 2:24 pm View user's profile Send private message
Karen



Joined: 20 Dec 2004
Posts: 20

Post Re: Using "Run" command in JAL script Reply with quote

Thanks for the simplification of commands... just starting with 24x7.
I'm still getting the same error with script below, even after adding path
to filenames...
I've verified this command can be run from any directory in DOS
?other ideas?

Dim file_namea, string, "I:\APS\fodh@DP"mmdd".dem"
Dim file_nameb, string, "I:\APS\fodh@DP"mmdd".chg"
Dim z_filename, string, "I:\APS\fodh@DP"mmdd".zip"
Dim command, string
Dim process, number

// Run the zip,encrypt command

ConcatEx "pkzipc -add -password=password -cryptalgorithm=rc4,128 ", z_filename, " ", file_namea, " ", file_nameb, command
Run (command, "i:\\aps", process)

: You are not passing the correct command. Don't expect 24x7 to figure out that
: in
: "i:\\aps\\pkzipc -add -password=password -cryptalgorithm=rc4,128
: z_filename file_namea file_nameb" line text z_filename file_namea
: file_nameb are variables and not just literals which are part of the
: command line.

: Here is what you need to do to fix your version of the script: Dim command,
: string
: ConcatEx "i:\\aps\\pkzipc -add -password=password
: -cryptalgorithm=rc4,128 ", z_filename, " ", file_namea,
: " ", file_nameb, command
: Run command, "i:\\aps", process

: This assumes that all referenced files are located in c:\apps because no
: other file path is given.

: ** Here is another tip. You can greatly simply this script if you use
: "@" macros. You can even convert this job to a program type job.
: Here is how

: ////////////
: Dim file_namea, string, "fodh@DP"mmdd".dem"
: Dim file_nameb, string, "fodh@DP"mmdd".chg"
: Dim file_nameb, string, "fodh@DP"mmdd".zip"
: ////////////

: ** To make it a 2-line job, do
: Dim process, number
: Run "i:\\aps\\pkzipc -add -password=password -cryptalgorithm=rc4,128
: fodh@DP"mmdd".zip fodh@DP"mmdd".dem
: "fodh@DP"mmdd".cfg", "i:\\aps",process)

: ** To convert it to a program type job copy the command part from Run to the
: job command line replacing \\ with single \

: Hope this helps.

Fri Jan 14, 2005 12:01 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Using "Run" command in JAL script Reply with quote

Before you run the command from job script copy it to the clipboard and then paste the result into the DOS prompt. Check if will run from there. Most likely you will find out some problems with the command sintax.
To copy it to the clpboard use ClipboardSet( command )

: Thanks for the simplification of commands... just starting with 24x7.
: I'm still getting the same error with script below, even after adding path
: to filenames...
: I've verified this command can be run from any directory in DOS
: ?other ideas?

: Dim file_namea, string, "I:\APS\fodh@DP"mmdd".dem"
: Dim file_nameb, string, "I:\APS\fodh@DP"mmdd".chg"
: Dim z_filename, string, "I:\APS\fodh@DP"mmdd".zip"
: Dim command, string
: Dim process, number

: // Run the zip,encrypt command

: ConcatEx "pkzipc -add -password=password -cryptalgorithm=rc4,128 ",
: z_filename, " ", file_namea, " ", file_nameb, command
: Run (command, "i:\\aps", process)

Fri Jan 14, 2005 12:29 pm View user's profile Send private message
Karen



Joined: 20 Dec 2004
Posts: 20

Post Re: Using "Run" command in JAL script Reply with quote

Copy clipboard to DOS works fine...
Could the issue be the location of the return value?
Tried:
Run (command, "i:\\aps", process) and
Run (command, "", process)
without success.
Where is process stored?

: Before you run the command from job script copy it to the clipboard and then
: paste the result into the DOS prompt. Check if will run from there. Most
: likely you will find out some problems with the command sintax.
: To copy it to the clpboard use ClipboardSet( command )

Fri Jan 14, 2005 12:42 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Using "Run" command in JAL script Reply with quote

When you paste it from the clipboard and run it from the DOS box from "C:\Program Files\24x7 Automation 3" directory does it work ok?

: Copy clipboard to DOS works fine...
: Could the issue be the location of the return value?
: Tried: Run (command, "i:\\aps", process) and
: Run (command, "", process)
: without success.
: Where is process stored?

Fri Jan 14, 2005 3:33 pm View user's profile Send private message
Karen



Joined: 20 Dec 2004
Posts: 20

Post Re: Using "Run" command in JAL script Reply with quote

Yes, the pkzipc command runs fine..

: When you paste it from the clipboard and run it from the DOS box from
: "C:\Program Files\24x7 Automation 3" directory does it work ok?

Fri Jan 14, 2005 4:37 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Using "Run" command in JAL script Reply with quote

Please try the following:

Dim file_namea, string, "I:\APS\fodh@DP"mmdd".dem"
Dim file_nameb, string, "I:\APS\fodh@DP"mmdd".chg"
Dim z_filename, string, "I:\APS\fodh@DP"mmdd".zip"
Dim command, string
Dim process, number

// Run the zip,encrypt command

ConcatEx "i:\\aps\pkzipc.exe -add -password=password -cryptalgorithm=rc4,128 ", z_filename, " ", file_namea, " ", file_nameb, command
Run (command, "i:\\aps", process)

: Yes, the pkzipc command runs fine..

Fri Jan 14, 2005 4:50 pm View user's profile Send private message
Karen



Joined: 20 Dec 2004
Posts: 20

Post Re: Using "Run" command in JAL script Reply with quote

Cut/pasted into new job.... still erroring
Create process failed
Return Code 2 - System could not find file specified

: Please try the following
: Dim file_namea, string,
: "I:\APS\fodh@DP"mmdd".dem"
: Dim file_nameb, string, "I:\APS\fodh@DP"mmdd".chg"
: Dim z_filename, string, "I:\APS\fodh@DP"mmdd".zip"
: Dim command, string
: Dim process, number

: // Run the zip,encrypt command

: ConcatEx "i:\\aps\pkzipc.exe -add -password=password
: -cryptalgorithm=rc4,128 ", z_filename, " ", file_namea,
: " ", file_nameb, command
: Run (command, "i:\\aps", process)

Fri Jan 14, 2005 5:08 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Using "Run" command in JAL script Reply with quote

3 more things you can try

1. Set command line to simple "i:\\aps\pkzipc.exe" and see if that works.
2. Set the command line to "cmd /C i:\\aps\pkzipc.exe ... and the rest goes here as it was before"
3. Do the following
Dim ....
...
FileSave "i:\\aps\\zipit.bat", command
Run "i:\\aps\\zipit.bat", "i:\\aps", process

Please let us know what you get.

: Cut/pasted into new job.... still erroring
: Create process failed
: Return Code 2 - System could not find file specified

Fri Jan 14, 2005 5:31 pm View user's profile Send private message
Karen



Joined: 20 Dec 2004
Posts: 20

Post Re: Using "Run" command in JAL script Reply with quote

Option 2 worked as follows...
"cmd /C pkzipc -add -password=....." with the remainder of the statement.
Thanks for your assistance!

: 3 more things you can try

: 1. Set command line to simple "i:\\aps\pkzipc.exe" and see if that
: works.
: 2. Set the command line to "cmd /C i:\\aps\pkzipc.exe ... and the rest
: goes here as it was before"
: 3. Do the following
: Dim ....
: ...
: FileSave "i:\\aps\\zipit.bat", command
: Run "i:\\aps\\zipit.bat", "i:\\aps", process

: Please let us know what you get.

Tue Jan 18, 2005 3:49 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.