starting folder of CMD.exe


  1. Posts : 107
    Windows 7 Professional 64 bit
       #1

    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 Computer


  2. Posts : 1,849
    Windows 7 x86/x64, Server 2008r2, Web Server 2008
       #2

    It is the way the file system is set up... what is your preference of start locations?
      My Computer


  3. Posts : 6,285
    Windows 10 Pro X64
       #3

    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 Computer


  4. Posts : 107
    Windows 7 Professional 64 bit
    Thread Starter
       #4

    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.
    Last edited by broiyan; 30 Nov 2010 at 23:42. Reason: correction
      My Computer


  5. Posts : 1,261
    Windows 7 Professional 32-bit SP1
       #5

    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":
    starting folder of CMD.exe-image1.jpg

    5) In the "Shortcut" tab, change the "Start In" value to something else, which should be a valid path. The default is %HOMEDRIVE%%HOMEPATH%
    starting folder of CMD.exe-image2.jpg starting folder of CMD.exe-image4.jpg 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:
    starting folder of CMD.exe-image3.jpg
    5) In the "Shortcut" tab, change the "Start In" value to something else, which should be a valid path. The default is %HOMEDRIVE%%HOMEPATH%
    starting folder of CMD.exe-image2.jpg starting folder of CMD.exe-image4.jpg starting folder of CMD.exe-image5.jpg

    6) Click OK
      My Computer


  6. Posts : 1,117
    Windows 7 Ultimate x64
       #6

    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 Computer


  7. Posts : 107
    Windows 7 Professional 64 bit
    Thread Starter
       #7

    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 Computer


  8. Posts : 1,117
    Windows 7 Ultimate x64
       #8

    broiyan said:
    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 Attached Thumbnails starting folder of CMD.exe-capture.jpg  
      My Computer


  9. Posts : 1,814
    XP / Win7 x64 Pro
       #9

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


 

  Related Discussions
Our Sites
Site Links
About 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 09:56.
Find Us