Delete file with command in .bat file
pachanga
Posted messages
928
Status
Membre
-
Pierrot6150 Posted messages 3186 Status Membre -
Pierrot6150 Posted messages 3186 Status Membre -
Hello,
I'm trying to test file deletion with a ".bat" file and it never works. I've followed instructions from two computer sites with various command options and it never works.
examples tried
del c:\test
or
del c:\test\*.*
or
"Here's how to create a Windows Batch File that deletes the contents of GIMP's thumbnail folder:
1. On your desktop, right-click and create a new Text Document.
2. Notepad will launch. Now insert the following line into notepad:
del C:\Users\Owner\.thumbnails\normal\*.* /Q
"
I know I need to replace some terms like the username or folder
if someone can guide me through this, it would be appreciated.
Thanks! :)
Configuration: ASUS P5QPL VM- INTEL E5400 2.7GHZ- DDR2RAM4GO- WINDOWS XP SP3 -GT220GEFORCE, Windows XP / Internet Explorer 8.0
I'm trying to test file deletion with a ".bat" file and it never works. I've followed instructions from two computer sites with various command options and it never works.
examples tried
del c:\test
or
del c:\test\*.*
or
"Here's how to create a Windows Batch File that deletes the contents of GIMP's thumbnail folder:
1. On your desktop, right-click and create a new Text Document.
2. Notepad will launch. Now insert the following line into notepad:
del C:\Users\Owner\.thumbnails\normal\*.* /Q
"
I know I need to replace some terms like the username or folder
if someone can guide me through this, it would be appreciated.
Thanks! :)
Configuration: ASUS P5QPL VM- INTEL E5400 2.7GHZ- DDR2RAM4GO- WINDOWS XP SP3 -GT220GEFORCE, Windows XP / Internet Explorer 8.0
del C/test/*.*
or
del C/test/
Honestly, I don't know what it takes to work.
I have no error messages.
del c:\test\*.* (all files in the test directory) or del c:\test\test.txt (only the test.txt file)
To avoid the confirmation prompt, add /q at the end (but you need to be sure of what you are deleting)
Thank you!!
For your information:
This example does not work, that's normal.
del C/test/*.*
or
del C/test/
The /
is reserved to indicate to Windows that a parameter is being input in the command line.
More info under the command prompt DEL /?
* 1 space between DEL and /
PS:
You also need to specify the drive with a colon (missing from you) C: