1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Help writing a batch file to capture network printers and mapped drives

Discussion in 'DOS/Other' started by lexvegas, Nov 9, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. lexvegas

    lexvegas Thread Starter

    Joined:
    Nov 9, 2011
    Messages:
    1
    I was trying to write a batch file that while logged into a users account in Win7 or WinXP, I could capture network printers and network mapped drives. Then the captured details of the network printers and mapped drives could be put in a .txt file on my thumb drive.

    Any help?!?
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    The Net Use command will show you all the mapped drives on the computer. I am not sure how to get a list of the network printers. Will try and look into that for you.
     
  3. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    This following command will get you all printers installed on the system. I am not sure how to just get the Networked printers.

    Code:
    cscript c:\windows\system32\prnmngr.vbs -l
     
  4. valis

    valis Moderator

    Joined:
    Sep 24, 2004
    Messages:
    77,750
    wouldn't that require prnmgr.vbs? I don't have that on my W7 rig.......at least, I don't think I do.
     
  5. valis

    valis Moderator

    Joined:
    Sep 24, 2004
    Messages:
    77,750
    whups, yes I do.....it's in the printing_admin_scripts subfolder.....my error, Squashman.......
     
  6. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    Thanks for checking that it is there on Windows 7. I assumed it was but wasn't sure.
     
  7. valis

    valis Moderator

    Joined:
    Sep 24, 2004
    Messages:
    77,750
    i just changed it to

    Code:
    C:\Users\user.name>cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prn
    mngr.vbs -l
    worked like a charm.

    Thanks, Squashman. Didn't even know that one was there.
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Help writing batch
  1. Lunderandy
    Replies:
    5
    Views:
    748
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1026211

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice