Coffeehouse Thread

12 posts

Windows 7 At Your Service

Back to Forum: Coffeehouse
  • User profile image
    earnshaw

    So I'm trying to get some work done using Windows 7.  I notice that the initial current working directory in the command line shell matches whatever directory cmd.exe is launched from.   I copied CMD.EXE to a directory in C:\Users.  That changed the initial working directory to the directory that I want, but then cmd.exe is unable to find an unidentified file that permits it to construct certain messages -- probably a systematic way to customize CMD.EXE for non-English speakers.   So, what is the official received way to get the initial current working directory the way I want it in CMD.EXE?    Please indicate where in the documentation this is stated.  Next on our agenda is Windows 7's handling of hugely expensive BD-ROM media.  You put a blank in the BD-ROM drive.  Windows 7 recognizes it as blank and opens Windows Explorer with a suggestion that you might drag and drop stuff to be burned to the blank.  When you put more in the bag than it will hold, Windows 7 opens the drive without telling you that you've tried to put 10 pounds in a 5 pound bag.   The stuff that is staged in Windows Explorer stays staged in Windows Explorer and the blank is permanently ruined.  It makes a nice coaster.  It cannot be closed.   I cannot be read.  Windows 7 reports that it is both empty and beyond full at the same time.  

  • User profile image
    W3bbo

    "So, what is the official received way to get the initial current working directory the way I want it in CMD.EXE?"

     

    cmd /k "cd %1"

     

     

  • User profile image
    Sven Groot

    W3bbo said:

    "So, what is the official received way to get the initial current working directory the way I want it in CMD.EXE?"

     

    cmd /k "cd %1"

     

     

    You might want to try cd /d or pushd otherwise it won't change drive.

     

    Also, you can just shift-right click a folder in explorer and choose open command window here.

  • User profile image
    Cannot​Resolve​Symbol

    Sven Groot said:
    W3bbo said:
    *snip*

    You might want to try cd /d or pushd otherwise it won't change drive.

     

    Also, you can just shift-right click a folder in explorer and choose open command window here.

    Or just set the "start in" directory of the shortcut you're using to open cmd.exe.

  • User profile image
    earnshaw

    CannotResolveSymbol said:
    Sven Groot said:
    *snip*

    Or just set the "start in" directory of the shortcut you're using to open cmd.exe.

    Or just set the "start in" directory...

     

    That is the first thing I tried.   It doesn't work on Windows 7.

     

    Also new in Windows 7, you can map a network share to a drive letter and Windows 7 will not reliably recognize it in the command shell.   NET USE works reliably to do the same thing.  

  • User profile image
    Sven Groot

    earnshaw said:
    CannotResolveSymbol said:
    *snip*

    Or just set the "start in" directory...

     

    That is the first thing I tried.   It doesn't work on Windows 7.

     

    Also new in Windows 7, you can map a network share to a drive letter and Windows 7 will not reliably recognize it in the command shell.   NET USE works reliably to do the same thing.  

    That is the first thing I tried.   It doesn't work on Windows 7.

    Then you're doing something wrong. It works fine here.

  • User profile image
    Cannot​Resolve​Symbol

    Sven Groot said:
    earnshaw said:
    *snip*

    Then you're doing something wrong. It works fine here.

    Same here.  I tried it on Windows 7 before I posted to make sure that it works.

  • User profile image
    earnshaw

    W3bbo said:

    "So, what is the official received way to get the initial current working directory the way I want it in CMD.EXE?"

     

    cmd /k "cd %1"

     

     

    Excellent.  It works exactly the way I wanted it.  Thank you. 

  • User profile image
    earnshaw

    CannotResolveSymbol said:
    Sven Groot said:
    *snip*

    Same here.  I tried it on Windows 7 before I posted to make sure that it works.

    A thousand pardons.   I tried it AGAIN here and now it works.   After all, it SHOULD work.    

  • User profile image
    AndyC

    earnshaw said:
    CannotResolveSymbol said:
    *snip*

    Or just set the "start in" directory...

     

    That is the first thing I tried.   It doesn't work on Windows 7.

     

    Also new in Windows 7, you can map a network share to a drive letter and Windows 7 will not reliably recognize it in the command shell.   NET USE works reliably to do the same thing.  

    "Also new in Windows 7, you can map a network share to a drive letter and Windows 7 will not reliably recognize it in the command shell.   NET USE works reliably to do the same thing."

     

    Elevated command prompts (and elevated processes in general) won't see drive mappings that were made un-elevated (and vice-versa). This is partially down to the mechanism used by Windows to perform elevation and partially down to the fact that relying on drive mappings being available in both contexts would cause a whole raft of compatibility issues when using over-the-shoulder elevation.

  • User profile image
    earnshaw

    AndyC said:
    earnshaw said:
    *snip*

    "Also new in Windows 7, you can map a network share to a drive letter and Windows 7 will not reliably recognize it in the command shell.   NET USE works reliably to do the same thing."

     

    Elevated command prompts (and elevated processes in general) won't see drive mappings that were made un-elevated (and vice-versa). This is partially down to the mechanism used by Windows to perform elevation and partially down to the fact that relying on drive mappings being available in both contexts would cause a whole raft of compatibility issues when using over-the-shoulder elevation.

    I withdraw my "thousand pardons."   If you change the Start In directory in a shortcut on the desktop, it works as it should.   If you change the same thing in a shortcut on the Start Menu, the change you make is IGNORED.  This is a capital BUG.   I expect a fix for this will appear within a week on Update Tuesday.   By the way, what is an "Over-the-Shoulder" elevation?

  • User profile image
    AndyC

    earnshaw said:
    AndyC said:
    *snip*

    I withdraw my "thousand pardons."   If you change the Start In directory in a shortcut on the desktop, it works as it should.   If you change the same thing in a shortcut on the Start Menu, the change you make is IGNORED.  This is a capital BUG.   I expect a fix for this will appear within a week on Update Tuesday.   By the way, what is an "Over-the-Shoulder" elevation?

    An Over-the-Shoulder elevation is one which causes a complete change of user context. For example:

     

    * User A is a limited user and launches a "Run As Administrator" application,  AppX

    * Windows gives a UAC prompt, with a username/password dialog (since User A can't elevate themselves)

    * User B, an Administrator, enters their credentials

    * AppX launches in the context of User B's elevated token

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.