Reply
Old November 20th, 2003 Top | #1
 
the_tazinator's Avatar
Are we there yet?
Joined: May 2002
Location: In a house
Posts: 177
Reputation: 40
Power: 120

Default Batch File Help

I am trying to write a batch file that compares two files and if they are different, call another batch file. I have everything working except for one small glitch in the compare command. After the compare is done, it asks you if you want to compare any more files.

Is the any way to suppress this prompt or automatically answer "N" so that the batch file will continue?
the_tazinator is offline   Reply With Quote
Old November 20th, 2003 Top | #2
 
yoyo's Avatar
_________________
Joined: July 2002
Posts: 1,557
Reputation: 160
Power: 133

Default

Can you use the fc command?
yoyo is offline   Reply With Quote
Old November 20th, 2003 Top | #3
 
the_tazinator's Avatar
Are we there yet?
Joined: May 2002
Location: In a house
Posts: 177
Reputation: 40
Power: 120

Default

I figured it out, I cant' splel thnisg rite, but now I have another problem.

I want to be able to rename a file based on the system time.

Something like: rename c:\file.txt <date>.txt

Any Ideas?

Thanks!
the_tazinator is offline   Reply With Quote
Old November 20th, 2003 Top | #4
 
yoyo's Avatar
_________________
Joined: July 2002
Posts: 1,557
Reputation: 160
Power: 133

Default

You could use now.exe from the Resource Kit tools. (Attached - unzip to system32, or anywhere else included in your path)

If you want the date the command would be something like

for /f "skip=1 tokens=1,2,3,5" %%a in ('now') do ren C:\file.txt %%a_%%b_%%c_%%d.txt


edit:

Just remembered the date command

for /f "tokens=2,3,4 delims=/ " %%a in ('date /t') do ren C:\file.txt %%a_%%b_%%c.txt
yoyo is offline   Reply With Quote
Old November 21st, 2003 Top | #5
 
the_tazinator's Avatar
Are we there yet?
Joined: May 2002
Location: In a house
Posts: 177
Reputation: 40
Power: 120

Default

Thanks!

I will give it a try.
the_tazinator is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
vbscript or batch file to play audio file for user on startup Punkrulz Web Design & Coding 10 November 29th, 2006 2:48pm
BATCH file help dillinja Web Design & Coding 0 March 24th, 2006 10:43am
Batch FIle PLEASE HELP arew264 Windows Desktop Systems 6 February 24th, 2005 1:56am
Batch File Q omg its nlm Web Design & Coding 4 March 10th, 2004 2:24am
XP Batch file RogerPhillis Windows Desktop Systems 4 November 25th, 2002 12:18am