Yzöwl Posted June 7, 2007 Share Posted June 7, 2007 In DEL "%~f0" %~f0 expands to the fully qualified path name of the batch file itself, i.e. DEL "C:\Documents and Settings\Administrator\Desktop\Test bat.cmd".However, as I stated in my reply the only line required is DEL %0; this will work regardless of spaces in the path or file name. The Q switch is not and will never be required in this case. People wrongly assume that /Q means quiet, it does, but only when using on global wildcards. The F switch, DEL/F %0, shouldn't be requied either, why create a read only self deleting file? Link to comment Share on other sites More sharing options...
NOTS3W Posted June 7, 2007 Share Posted June 7, 2007 In DEL "%~f0" %~f0 expands to the fully qualified path name of the batch file itself, i.e. DEL "C:\Documents and Settings\Administrator\Desktop\Test bat.cmd".Well, I learned something today. Thanks Yzöwl. That explains why it's in quotes, too.I understand and agree with your other points. I think some people may just insert /Q and /F on all of their DEL commands whether they're needed or not "just in case". I was trying to compare the two commands thinking that ~F might somehow be comparable to /F. So DEL /Q /F %0 is equivelent to DEL /Q /F "%~f0" (but with a full path) and DEL %0 is equivelent to DEL "%~f0". Good to know.Thanks for explaining that.Ray Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now