English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

my command is in a batch file.It is- for /f %%i in (D:\Storage\Links\Control Panel\Restore\erase.txt) do @erase %%i- I have a list of destinations for deletion in "erase.txt".1 question is how can I get this same batch file to do more than 1 command in the same .txt file.How it is now all items in erase.txt would follow the Erase command.Problem is I want to have only 1 batch file and 1 .txt file with different commands.Second problem is how in the world do you use spaces in the txt file.for example:Control Panel has 1 space.Apparently using " at beginning and end of command doesnt work.I tried putting all names in DOS form but it seems some names of directories dont have a dos form.Kinda odd,its seems only newer files dont have one even after reboot.Im also having the same problem with the batch file destination- D:\Storage\Links\Control Panel\Restore\erase.txt-spaces wont work and cant use "" so how can I do this when some names have no DOS form. Thanks alot if you can help with any

2007-01-16 04:54:16 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

Try not to use spaces in path dirs or files, just do this.

take the first 6 characters of every dir / filename and then add them a ~1 (alt 126 and a one) that's the way you should do it.

2007-01-16 05:08:25 · answer #1 · answered by Kool_Joss 2 · 0 0

For the space issue, try using %20% wherever there is a space in the name.

As far as running more than one command from the command prompt, you should be able to multiple commands into a bat file. Create it notepad (not a word processor as they include formating characters). But one command on each line of the file. Save it as a txt file, and then change the extension to bat. From the command prompt, you simply type the name of the batch file and it will run the commands within the file.

2007-01-16 13:02:42 · answer #2 · answered by dewcoons 7 · 0 0

Call another batch file from within the current batch file.

2007-01-16 13:03:38 · answer #3 · answered by Michael 3 · 0 0

You should ask this question to a qualified person and dont take to chance the answers you will get here. Here's a site I use to work on. It is free and they can give you the correct answer!

2007-01-16 13:02:34 · answer #4 · answered by bunnicula 4 · 0 0

fedest.com, questions and answers