Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: starting folder of CMD.exe

30 Nov 2010   #1

Windows 7 Professional 64 bit
 
 
starting folder of CMD.exe

From the start menu, invoking CMD.exe will take me to c:\users\owner.

However, if I right click the start menu icon in order to make a desktop shortcut, the resulting short cut takes me to c:\windows\system32.

Why the inconsistency and how do I fix this?

My System SpecsSystem Spec
.

30 Nov 2010   #2

Windows 7 x86/x64, Server 2008r2, Web Server 2008
 
 

It is the way the file system is set up... what is your preference of start locations?
My System SpecsSystem Spec
30 Nov 2010   #3

Windows 8 Core X64
 
 

If I right click on the Start button (Orb) the only choices I'm given are Properties and Open Windows Explorer. How are you creating a shortcut on the Desktop?

If you right click on the shortcut is there a Target field? If so just add C:\Users\owner after (make sure there is a space before C.
My System SpecsSystem Spec
.


30 Nov 2010   #4

Windows 7 Professional 64 bit
 
 

Ztruker, sorry, I was just making a brief description of the process for making the shortcut.

I don't right click the start menu orb, rather I go to "search programs and files" and type "cmd" and when the item appears I right click and then select "send to" and "desktop shortcut".

No I don't think I should use the "target" field where I can give it a path.

EDIT: but from the desktop shortcut I can see a "start in". I guess I will just edit that. Sounds a safer way to proceed compared to RegEdit which a quick Google shows is how some people deal with picking the starting folder. There seem to be some warnings on the internet about using RegEdit for this purpose. For my needs, that is, just the short cut there obviously won't be side effects because no commercial software will ever try to use my shortcut.
My System SpecsSystem Spec
30 Nov 2010   #5

Windows 7 Ultimate x64
 
 

The easiet way to fix this to to modify the shortcut:

1) Click the Start Orb
2) Click "All Programs"
3) Click "Accessories"
4) Right-click "Command Prompt", then select "Properties":
Name:  Image1.jpg
Views: 9
Size:  88.3 KB

5) In the "Shortcut" tab, change the "Start In" value to something else, which should be a valid path. The default is %HOMEDRIVE%%HOMEPATH%
Name:  Image2.jpg
Views: 26
Size:  60.8 KB Name:  Image4.jpg
Views: 23
Size:  56.0 KB starting folder of CMD.exe-image5.jpg

6) Click OK


If, like me, you have pinned a Command Prompt icon to the taskbar, the do this:
1) Right-click the pinned icon
2) In the jump list, right-click "Command Prompt"
3) Select Properties:
Name:  Image3.jpg
Views: 3
Size:  31.2 KB
5) In the "Shortcut" tab, change the "Start In" value to something else, which should be a valid path. The default is %HOMEDRIVE%%HOMEPATH%
Name:  Image2.jpg
Views: 26
Size:  60.8 KB Name:  Image4.jpg
Views: 23
Size:  56.0 KB Click image for larger version

Name:	Image5.jpg
Views:	4
Size:	36.0 KB
ID:	119256

6) Click OK


My System SpecsSystem Spec
01 Dec 2010   #6

Windows 7 Ultimate x64
 
 

I'm not very versed, but my attempt to answer your answer is this:

There is no inconsistency... The program is starting and behaving as it should.

The shortcut is a pointer to the location the program actually resides, C:\Windows\System32.

Running the CMD from the start menu shows you the local user at the prompt who ran the command. However, if you look at the Title Bar of a CMD prompt ran by a local user, it will read C:\Windows\System32\cmd.exe, showing that the program is still being run from C:\Windows\System32.

And the difference in running the prompt as Administrator is that the Title Bar will read Administrator: C:\Windows\System32\cmd.exe, but the prompt still reads: C:\Windows\System32.

In a nutshell, running it from the Start Menu will show the local user who ran it at the prompt, while the shortcut will be is as if you went into the the C:\Windows\System32 folder and ran the cmd.exe from there. In either case, the program is running from the location it is stored: C:\Windows\System32.
My System SpecsSystem Spec
01 Dec 2010   #7

Windows 7 Professional 64 bit
 
 
mpcrsc562

mpcrsc562, there is most definitely an inconsistency but thanks for the reply.

In my query, please understand that "takes me to" means the "the current directory". Nowhere in my query have I referred to the location the program resides for that is not my concern. Others have answered the question to my satisfaction already. Thanks.
My System SpecsSystem Spec
01 Dec 2010   #8

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by broiyan View Post
mpcrsc562, there is most definitely an inconsistency but thanks for the reply.

In my query, please understand that "takes me to" means the "the current directory". Nowhere in my query have I referred to the location the program resides for that is not my concern. Others have answered the question to my satisfaction already. Thanks.
I'm glad others have answered your query to your satisfaction.

But, I stand by my word, there was no inconsistency--it is just that running the program and using the shortcut did not provide you with your desired outcome.

The uploaded pics are the property boxes for cmd.exe--one property box from the start menu and the other property box from the desktop shortcut I created. They are exactly the same. You stated "invoking the cmd.exe takes me to..." and that's what it did. When you ran it from the start menu, it took you to the directory of who ran it, C:\Users\Name. A shortcut is different in that it is a pointer to where a program resides on the disk, as I've already stated. So, creating a shortuct of cmd.exe from the start menu icon will give you a starting directory of where the program is: C:\Windows\System32.

It seems you were expecting something different, but running the program from the start menu or from the shortcut did what they were supposed to do. Therefore, no inconsistency.


Attached Thumbnails
starting folder of CMD.exe-capture.jpg  
My System SpecsSystem Spec
01 Dec 2010   #9

XP / Win7 x64 Pro
 
 

^ This is pretty much it. Good explanation, mpcrsc, as the system isn't doing two similar things differently, rather two different things differently.
My System SpecsSystem Spec
Reply

 starting folder of CMD.exe





Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 11:22 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33