Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to change the directory from cmd

example i want to set C:\ drive to D:\my folder\common\myimg.jpg

Note: D:\my folder\common\
contains space in folder name is it allowed if yew then how
Posted

You should first change drive, then issue the change directory command, namely:
d:
cd "\my folder\common"

or else
cd /d "D:\my folder\common"


You have to use double quotes (") since your folder name contains blanks.
 
Share this answer
 
v3
Comments
[no name] 20-Jun-13 4:11am    
if i am writing full path "D:\my folder\common\myimg.jpg" then i am getting error The Directory name is invalid and if i write "D:\my folder\common\" then it moves to that directory
please help...
Johnny J. 20-Jun-13 4:19am    
You can't execute a jpg image from the command prompt. It needs to be an executable file.
In this case, the system thinks that you jpg file is a folder name.
[no name] 20-Jun-13 5:53am    
Thanks for help............
now i understud the problem
CPallini 21-Jun-13 1:46am    
@H.Brydon: thank you for adding the alternative, I didn't know about.
Follow these procedures...


c:\documents and settings\sun>

c:\documents and settings\sun> cd\          

c:>

c:.>d:

d:>

d:> cd my folder

d:\myfolder>cd comman


d:\myfolder\comman>

from here u can access the files in the directory.

Hope it will help you
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900