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.
Batch File
Name: Stefan Mai Date: July 10, 2001 at 16:03:08 Pacific
Comment:
I have a simple problem. What I need to do is remove the extension from a variable such as %a (contains a filename) and put this into %b.
Name: kev100 Date: July 10, 2001 at 20:38:20 Pacific
Reply:
This is so cool! I just guessed, but it works. Little things like this is why I like DOS so much....even in our GUI world.
Just use a wildcard. Example...
rename *.doc *.txt
will change the every .doc extension of the files IN THE CURRENT DIRECTORY to a .txt extension.
LIKEWISE
rename *.doc *
will simply remove the .doc extension of every file (which has a .doc extension).
HOWEVER, be VERY, VERY careful not to remove it from files which you DO want to have it. This is a very unforgiving command. MAKE BACKUP COPIES OF THE FILES YOU PLAN TO MANIPULATE.
0
Response Number 2
Name: Secret_Doom Date: July 11, 2001 at 21:29:33 Pacific
Reply:
Here goes a more secure way: (I'm using %a% and %b%)
@echo off set b= if "%extout%"=="1" goto parse set extout=1 echo ; |choice /c;%a%; %0;>out.bat out.bat :parse IF "%1"=="[" SHIFT IF "%1"=="]?" goto end IF "%1"=="." goto end IF NOT "%B%"=="" SET B=%B%%1 IF "%B%"=="" SET B=%1 SHIFT GOTO parse :end set extout= if exist out.bat del out.bat
That's it. That weren't made by me. Laurence Soucy did it (just a little different) and I have adapted it to your case
Summary: I need help with writing a batch file that returns an error code to another application (app1). My batch file is called by another application, when my batch file runs, it calls a VBS Script. This scr...
Summary: Hi i have made a batch file which installs a bit of software and then runs it. i need a command which after the first line of the batchfile has been run it waits 20 seconds and then the second line ru...