Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
rename batch file
Name: OddMatt Date: November 6, 2002 at 07:21:57 Pacific OS: win2k CPU/Ram: p4 256mb
Comment:
hi ,im fairly new to scipting anything in DOS so this maybe fairly simple, or not (tbh im not entirely sure). As this is my first application i have written id really really like it to work, so il really appreciate some help.. I have created two batch files - one renames file x to x1, the other renames it back to x...... what i really need is one file to do both ie. check the filename, so if x=0 then it will rename x by running batch file 1 etc etc hope someone can help me on my path to greater scripting :) cheers
Name: chris db Date: November 6, 2002 at 08:13:51 Pacific
Reply:
here you are oddmatt:
@echo off if exist x goto bob rename x1 x goto end :bob rename x x1 :end
The '@echo off' line is just (as you may know) to stop the batch commands appearing as the program runs. 'bob' and 'end' are just labels and can be anything as long as they match up.
0
Response Number 2
Name: OddMatt Date: November 6, 2002 at 08:18:19 Pacific
Summary: You want to rename all files from current directory to a same extention, is that it? What do you mean by "compiled batch"? You're using a program like bat2exe or bat2com to convert the script, is that...
Summary: Help! I'm have been trying to figure a way to write a batch file that will automatically rename a specific file by the date and time. example: skidog.txt ==> jan191230.txt ...
Summary: I need to write a DOS Batch file that renames a file to it`s original name plus todays date. e.g. TEST.TXT becomes TEST220102.TXT I need the batch file to dynamically look up todays date and append th...