|
-
July 29th, 2008, 06:26 AM
#1
Help Creating Batch File
Hi
does anyone have an example of an "audit" batch file ? I need to capture machine name, user name, drive mappings, print queues etc
thanks
-
August 4th, 2008, 04:28 AM
#2
Registered User
Hello cscsi and welcome to Windrivers forum
You should do something like this - create a login script containing a bat file .
Create a share with write permissions for all the users on the server (\\servername\share)
on the batch file write:
@echo off
Echo new computer Entry >>\\servername\share\logger.txt
echo %date%-%time% >>\\servername\share\logger.txt
Echo %username% >>\\servername\share\logger.txt
Echo %computername% >>\\servername\share\logger.txt
Echo net use >>\\servername\share\logger.txt
cscript c:\windows\system32\prndrvr.vbs -l >>\\servername\share\logger.txt
The last line (printer information) generates a lot of lines (depends on number of printers).
You can also do this for a specific user by using (if you want for machine use %computername%):
@echo off
del \\servername\share\%username%.txt
Echo new computer Entry >>\\servername\share\%username%.txt
echo %date%-%time% >>\\servername\share\%username%.txt
Echo %username% >>\\servername\share\%username%.txt
Echo %computername% >>\\servername\share\%username%.txt
Echo net use >>\\servername\share\%username%.txt
cscript c:\windows\system32\prndrvr.vbs -l >>\\servername\share\%username%.txt
Good Luck,
Gabriel
Real stupidity beats Artifical Intelligence
Avatar courtesy of A D E P T
Similar Threads
-
By patousf in forum CD-ROM/CDR(-W)/DVD Drivers
Replies: 24
Last Post: January 23rd, 2009, 09:20 PM
-
By Niclo Iste in forum DOS
Replies: 5
Last Post: May 8th, 2008, 07:31 PM
-
By EuphoriA in forum CD-ROM/CDR(-W)/DVD Drivers
Replies: 53
Last Post: December 20th, 2007, 07:17 AM
-
By Master Frodo UK in forum Programming And Web Design
Replies: 1
Last Post: August 21st, 2006, 10:34 AM
-
By thia in forum Windows 95/98/98SE/ME
Replies: 6
Last Post: March 15th, 2006, 02:10 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks