Question:
Opening and deleting files in CMD?
2013-12-11 12:56:30 UTC
I would like to know how to delete and open files in CMD, for example from the path C:\Users\Harry\Music\Fever> I would like to play the song named "01 your betrayal.wma" I have tried "explorer "C:\Users\Harry\Music\Fever"" which didn't open the file, only displayed its location in explorer and also I have tried "start "01 your betrayal.wma"" which only opened up CMD in a new window with "01 your betrayal" as the title, is this even possible? Also is there a command for deleting files from the directory?

All help is appreciated,
Cheers.
Three answers:
d blenz
2013-12-11 13:11:23 UTC
HI Harry

Based on the directory listing you have in your question, if you want to play a sound open the command prompt and browse to directory with the sound you want:



I am assuming: C:\Users\Harry\Music\Fever



when in there you can then type "dir" without the quotes this will list all file within that directory.



you can then browse until you find the wound you wan to play:



I am assuming its "01 your betrayal.wma" <- type it with quotes and once its the correct name the sound will play.

Also to be sure you type the correct name you can also copy the sound from the dir listing:

right click -> choose "mark" -> right click again -> choose "paste"



To delete a file in the command prompt you can also browse to the directory where the file you what to delete is located and type:

del "xxxx.jpg"



"xxx.jpg" <- you can replace the file you want to delete here.
Nunya
2013-12-11 13:19:14 UTC
in cmd if you type: (quotes are required when there is a space involved)

"C:\Users\Harry\Music\Fever\01 your betrayal.wma"

and it will run the file with the default program



to delete files in the cmd line, first navigate to the folder that the file is in. Then type:

del filename.wma



if you wanted to delete the wma file like had before, you could do:

del "C:\Users\Harry\Music\Fever\01 your betrayal.wma"
Evan
2013-12-11 13:04:32 UTC
I just tested this out and it worked. Go to the directory your music is in and just type the song file's name.



There is a delete command it is just del. all you do is type del and then the file name.

Hope this helps.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...