![SoftTree Technologies](templates/GreenTech/images/logo.gif) |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Tom Smit
Joined: 26 Jan 2000 Posts: 21
|
|
Date/File log grabs |
|
Assuming that all variables are defined. Basically what I'm trying to do is run a batch file with two command line arguments. However, this isn't quite working. Any ideas? I could possibly be using the file_name object wrong, i extended on one of the provided scripts, but i'm not sure quite where to go from here. // Get todays's date Today( today ) // Calculate yesterday's date DateAdd( today, -1, yesterday ) // Convert to string in mmddyyyy format Concat( file_name, "ex", file_name) Concat( yesterday, "yymmdd", file_name ) //Append file extension Concat( file_name, ".dat", file_name ) Concat( "c:\bin\make.bat ", @DP"yyyymm", command ) RunAndWait( command, "c:\bin",0, process_id ) RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0, process_id) Concat ("c:\bin\doit.bat ",@DP"yyyymm", command2 ) Concat (command2, file_name, command2) Run (command2, "c:\bin", process_id)
|
|
Wed Jan 26, 2000 5:05 pm |
|
![](templates/GreenTech/images/spacer.gif) |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7849
|
|
Re: Date/File log grabs |
|
What did you want to do in line > ? It looks like you are trying to something like the following: Concat( "c:\bin\make.bat ", @DP"yyyymm", command ) Concat ("ex", @DP"mmddyyyy", command2 ) Concat ("c:\bin\doit.bat ", command2, command2) Concat (command2, ".dat", command2) RunAndWait( command, "c:\bin", 0, process_id ) RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0, process_id) Run (command2, "c:\bin", process_id) : Assuming that all variables are defined. Basically what I'm trying to do is : run a batch file with two command line arguments. However, this isn't : quite working. Any ideas? I could possibly be using the file_name object : wrong, i extended on one of the provided scripts, but i'm not sure quite : where to go from here. : // Get todays's date : Today( today ) : // Calculate yesterday's date : DateAdd( today, -1, yesterday ) : // Convert to string in mmddyyyy format : Concat( file_name, "ex", file_name) : Concat( yesterday, "yymmdd", file_name ) : //Append file extension : Concat( file_name, ".dat", file_name ) : Concat( "c:\bin\make.bat ", @DP"yyyymm", command ) : RunAndWait( command, "c:\bin",0, process_id ) : RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0, : process_id) : Concat ("c:\bin\doit.bat ",@DP"yyyymm", command2 ) : Concat (command2, file_name, command2) : Run (command2, "c:\bin", process_id)
|
|
Wed Jan 26, 2000 6:47 pm |
|
![](templates/GreenTech/images/spacer.gif) |
Tom Smit
Joined: 26 Jan 2000 Posts: 21
|
|
Re: Date/File log grabs |
|
This might help a little more, i found something: Basically, i'm looking to create a file_name object with the exyymmdd.dat type of file, then pass it as the second argument to a batch file (doit.bat) ---cut---- // Get todays's date Today( today ) // Calculate yesterday's date DateAdd( today, -1, yesterday ) // Convert to string in mmddyyyy format Format( yesterday, "yymmdd", file_name) //Append file extension Concat( "ex", file_name, file) Concat( file, ".dat", file) Concat( "c:\bin\make.bat ", @DP"yyyymm", command ) RunAndWait( command, "c:\bin",0, process_id ) //RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0, process_id) Concat ("c:\bin\doit.bat ",file, command2 ) //Concat (command2, file , command2) Run (command, "c:\bin", process_id) ---cut----- : What did you want to do in line > ? : It looks like you are trying to something like the following: Concat( : "c:\bin\make.bat ", @DP"yyyymm", command ) : Concat ("ex", @DP"mmddyyyy", command2 ) : Concat ("c:\bin\doit.bat ", command2, command2) : Concat (command2, ".dat", command2) : RunAndWait( command, "c:\bin", 0, process_id ) : RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0, : process_id) : Run (command2, "c:\bin", process_id)
|
|
Wed Jan 26, 2000 6:57 pm |
|
![](templates/GreenTech/images/spacer.gif) |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7849
|
|
Re: Date/File log grabs |
|
Concat( "ex", @DP"yymmdd", file_name ) Concat( file_name, ".dat", file_name ) : This might help a little more, i found something: Basically, i'm looking to : create a file_name object with the exyymmdd.dat : type of file, then pass it as the second argument to a batch file (doit.bat) : ---cut---- : // Get todays's date : Today( today ) : // Calculate yesterday's date : DateAdd( today, -1, yesterday ) : // Convert to string in mmddyyyy format : Format( yesterday, "yymmdd", file_name) : //Append file extension : Concat( "ex", file_name, file) : Concat( file, ".dat", file) : Concat( "c:\bin\make.bat ", @DP"yyyymm", command ) : RunAndWait( command, "c:\bin",0, process_id ) : //RunAndWait( "c:\bin\logpull.exe", "c:\bin", 0, : process_id) : Concat ("c:\bin\doit.bat ",file, command2 ) : //Concat (command2, file , command2) : Run (command, "c:\bin", process_id) : ---cut-----
|
|
Wed Jan 26, 2000 7:08 pm |
|
![](templates/GreenTech/images/spacer.gif) |
Tom Smit
Joined: 26 Jan 2000 Posts: 21
|
|
Re: Date/File log grabs |
|
I figured that part out, the problem i'm having is passing two arguments to the batch file. : Concat( "ex", @DP"yymmdd", file_name ) : Concat( file_name, ".dat", file_name )
|
|
Wed Jan 26, 2000 7:10 pm |
|
![](templates/GreenTech/images/spacer.gif) |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7849
|
|
Re: Date/File log grabs |
|
So you want to concatenate 3 pieces into one piece? Concat( a, b, temp ) Concat( temp, c, result ) or even simplier (assuming that result = a in the beginning) Concat( result, b, result ) Concat( result, c, result ) : I figured that part out, the problem i'm having is passing two arguments to : the batch file.
|
|
Thu Jan 27, 2000 11:27 am |
|
![](templates/GreenTech/images/spacer.gif) |
Tom Smit
Joined: 26 Jan 2000 Posts: 21
|
|
Re: Date/File log grabs |
|
This is what i have: ---cut--- Concat ("c:\bin\doit.bat ",@DP"yymmdd", command2 ) Concat (command2, file_name , command2) Run (command2, "c:\bin", process_id) ---cut--- doit.bat is a batch file that wants to cd into \%1 (which should be the date) and then do something, and then copy file %2 (file_name). However, it's not even doing the cd right. It's staying right in the bin directory. : So you want to concatenate 3 pieces into one piece? : Concat( a, b, temp ) : Concat( temp, c, result ) : or even simplier (assuming that result = a in the beginning) : Concat( result, b, result ) : Concat( result, c, result )
|
|
Thu Jan 27, 2000 11:45 am |
|
![](templates/GreenTech/images/spacer.gif) |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7849
|
|
Re: Date/File log grabs |
|
Have you looked at the trace file? If not please turn on tracing in the Preferences. This will tell you where the script/or batch do not work as expected. : This is what i have: ---cut--- : Concat ("c:\bin\doit.bat ",@DP"yymmdd", command2 ) : Concat (command2, file_name , command2) : Run (command2, "c:\bin", process_id) : ---cut--- : doit.bat is a batch file that wants to cd into \%1 (which should be the date) : and then do something, and then copy file %2 (file_name). However, it's : not even doing the cd right. It's staying right in the bin directory.
|
|
Thu Jan 27, 2000 11:59 am |
|
![](templates/GreenTech/images/spacer.gif) |
Tom Smit
Joined: 26 Jan 2000 Posts: 21
|
|
Re: Date/File log grabs |
|
I see now where the problem is, it's what i thought. It's not putting a space between the two arguments. Instead of running doit.bat 200001 ex000125.dat it's running "doit.bat 200001ex000125.dat" : Have you looked at the trace file? If not please turn on tracing in the : Preferences. This will tell you where the script/or batch do not work as : expected.
|
|
Thu Jan 27, 2000 12:04 pm |
|
![](templates/GreenTech/images/spacer.gif) |
|
|
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
|
|
|