Switches /s /q

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
ahzong
Posts: 7
Joined: 04 Aug 2018 23:04

Switches /s /q

#1 Post by ahzong » 19 Aug 2018 03:00

I found this line of code:

Code: Select all

del /s /q C:\windows\temp\*.tmp
Could anyone explain to me what is code does? I guess it deletes everything in the temp folder.
I can't seem to understand /s and /q especially, nor to make sure they are called "switches".

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Switches /s /q

#2 Post by aGerman » 19 Aug 2018 03:39

You'll get help for every command if you execute yourcommand /? in a cmd window (del /? in your case). Besides of that we have a Command Index where you can look it up.
However option /s also deletes found .tmp files in subfolders of C:\windows\temp and option /q suppresses the prompt that asks you if you really want to delete all .tmp files because you specified a wildcard (asterisk) that is for "any name".

Steffen

ahzong
Posts: 7
Joined: 04 Aug 2018 23:04

Re: Switches /s /q

#3 Post by ahzong » 19 Aug 2018 04:38

Oh, that's very helpful! Thanks a lot.

Post Reply