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.
Bat File Help
Name: WolvenArrow Date: April 27, 2009 at 01:36:02 Pacific OS: Microsoft Windows Vista Business CPU/Ram: 2.2 GHz / 3582 MB Product: Asus / P5KPL-CM Subcategory: Batch
Comment:
I am trying to make a batch file that searches for a certain file or files, eg. "song.mp3" on the hard drive, and if the file(s) exist on the hard drive it deletes the directory the file(s) are in. eg.
I run the .bat file from my usb F:\ searches for the file from the usb (F:\) finds the file or files here: C:\Users\Richard\Music\song.mp3 Then the bat file deletes all the files that are in that directory only.
C:\Documents and Settings\Richard\Desktop\New Folder is the location of the song.mp3 ....
0
Response Number 4
Name: Judago Date: April 28, 2009 at 01:15:19 Pacific
Reply:
Add the /q switch to the rmdir to forgo confirmation "rmdir /s /q %%~dpG" it would also be an idea to add double quotes around "%%~dpG" to avoid any possible conflicts with spaces and ampersands.
rmdir /s /q "%%~dpG"
0
Response Number 5
Name: WolvenArrow Date: April 28, 2009 at 01:40:38 Pacific
Reply:
Awesome, thanks for your help
0
Response Number 6
Name: Judago Date: April 28, 2009 at 02:04:55 Pacific
Reply:
No problems...
One thought has come to mind though, what if song.mp3 happens to be on the desktop? I imagine that windows won't allow it to be removed, nor should it and if it does I'm unsure of the consequences.
0
Response Number 7
Name: WolvenArrow Date: April 28, 2009 at 02:12:11 Pacific
Reply:
hmmm, yeah well i better make sure that the certain file i might want to move isn't in a critical place like the program files folder or on the desktop ;)
Summary: I need some help with a bat file that I created. I am trying to make it stay minimized on my user's screens. Do I simply put Echo Off or @Echo Off in the bat file and where do I put it to take effec...
Summary: I want to make a bat file that will delete the Recent History in the My Documents . I have this right now . @ECHO OFF :START DEL "C:\Documents and Settings\add your computer name here \Recent\*.*" @E...
Summary: Please help... OK what this sounds like will be a virus, but none the less all a virus is is a desctructive program right? ok. I am looking for a batch script that when it runs the first time executed...