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?
Use \ instead of / as the path separator:
del %userprofile%\AppData\Roaming\MyFolder\myfile.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With