windows 7 - mapping network drive, sh.exe": no such file or directory

  • Crystal

    I'm trying to learn to use the command line and I googled on how to map network drives from the command line. I came across using the net command and the pushd command. We have a mapped network drive at work that I can go to in Windows Explorer by doing


    When I try

    pushd \\sf-testers\test-datasets\

    I get the response:

    sh.exe": pushd: \sf-testers\test-datasets: No such file or directory

    When I try

    net use x: \\sf-testers\test-datasets

    I get:

    System error 67 has occurred.
    The network name cannot be found.

    I'm running Windows 7 on bootcamp. What am I doing incorrectly? Thanks in advance!

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    windows xp - win xp - permanently map a network drives from command line?
  • barlop

    I can open "My Computer" network drive. Check "Reconnect at logon". And it is permanent. But I may want to clear the shares, and create them quickly. So I want to automatically do a few, so I want a fast way of doing it. I suppose I could write a batch and have it load with the command prompt. Lines like net use V: \\compg\dir But I want the network shares to load automatically when windows starts. I could put the bat in startup folder, but I don't want a command prompt opening up on every windows restart.

    I was hoping there might be a command to do it so it is permanent. or perhaps a windows scripting method..

    What are my options? I'm interested in what ways this can be done.

  • Related Answers
  • Brian
    net use V: \\compg\dir /persistent:yes

    is what you are looking for. Same as checking the "Connect automatically at boot" check box.

    Also, net use /delete v: to remove it

  • Sky

    Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "C:\Yourfile.bat" & Chr(34), 0 Set WshShell = Nothing

    Use this in a VBS....reference your path where C:\yourfile.bat is. It pops up a quick vbs screen (maybe half a sec) and you cant close it if you try to in my experience. By the time you try anyway the batch is already launched. Hope this helps

  • Dennis

    When I want to do this, I make a shortcut to the batch file then right click on the short cut, select properties, go to the "Shortcut" tab and change the "Run" option from "Normal Window" to "Minimized"