Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Del command in command prompt

I want to, for example, delete a file in AppData/Roaming/MyFolder/myfile.txt.

I use command prompt and typed this: del %userprofile%/AppData/Roaming/MyFolder/myfile.txt

But then the command prompt said: Parameter format not correct - "ppData"

Then I think again and used %appdata% and typed:del %appdata%/MyFolder/myfile.txt

But the command prompt said: Invalid switch - "MyFolder"

How to delete myfile.txt using %userprofile% or %appdata%? Is my syntax wrong?

like image 211
2 revs, 2 users 98% Avatar asked Apr 15 '26 22:04

2 revs, 2 users 98%


1 Answers

Use \ instead of / as the path separator:

del %userprofile%\AppData\Roaming\MyFolder\myfile.txt
like image 152
Greg Hewgill Avatar answered Apr 19 '26 17:04

Greg Hewgill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!