Need some command line help

Status
Not open for further replies.

Sui

Daemon Poster
Messages
665
Location
Socal
Ok short version first

I need to find a way to put the output of one program into the command line of another.

Dates.exe -> 6-3-2005
Zip %dates%.zip *.html
output into 6-3-2005.zip
is basicly what I want to do

If that doesn't make sence heres the long version

I have a stat program that generates html files, now in order to sort them I want to use the date as a filename for the zip file. So I have a date program that outputs the right format and a command line archive utility(zip program). .... MY Problem is I can't figure out how to set a variable from a txt file or output of the Date program, or use the output of the Date program in the command line of the zip program.

If anyonw can help please do.
 

dale5605

Daemon Poster
Messages
1,482
This might be better in another forum. I think the best solution would be Visual Basic but I'm not too good with that yet.
 

Win2kpatcher

Fully Optimized
Messages
2,171
I was thinking something along the lines of a nice perl script. Programming is my weakest link though. Perhaps Inaris will see this as he seems to be really in tune with scripting in perl.
 

Sui

Daemon Poster
Messages
665
Location
Socal
Well if there was a Dos forum then I would have posted there, cause thats where this more or less belonged. I didn't want to post into programing forums because its not really programing, and I didn't want to piss them off.

Anyway I finally found a solution after about 12 different searches I found this. Basicly you put 'set var=' in one text file, and use the output function to make a 2nd text file, and use copy to merge the two files into a single batch file... that looks like 'set var=6-5' and tada set variable from output of another program.

date.exe m-d > date.txt

COPY CON INIT.TXT
SET VARNAME=^Z (thats ctrl + z)

copy init.txt+date.txt varset.bat

I feel kind of stupid now that I battled with it for 3 days. I knew I was gonna feel stupid once I found the answer on day #1. :eek:
 
Status
Not open for further replies.
Top