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



## lexvegas (Nov 10, 2011)

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?!?


----------



## Squashman (Apr 4, 2003)

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.


----------



## Squashman (Apr 4, 2003)

This following command will get you all printers installed on the system. I am not sure how to just get the Networked printers.


```
cscript c:\windows\system32\prnmngr.vbs -l
```


----------



## valis (Sep 24, 2004)

wouldn't that require prnmgr.vbs? I don't have that on my W7 rig.......at least, I don't _think_ I do.


----------



## valis (Sep 24, 2004)

whups, yes I do.....it's in the printing_admin_scripts subfolder.....my error, Squashman.......


----------



## Squashman (Apr 4, 2003)

Thanks for checking that it is there on Windows 7. I assumed it was but wasn't sure.


----------



## valis (Sep 24, 2004)

i just changed it to


```
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.


----------

