11 replies
by billc124
by joshhansen
by joseph moore
Ok, here you go.
This is a BAT file that will collect the IP address of the machine, the Windows version, the logged-in user name running the BAT file, and it will append all of this to a single text file. You can put this in a logon script for all of your users to use, and point it to a central share. This BAT will make a separate text file per user name. So, you will get separate files per user.
Here is the BAT file contents (call it NTVER.BAT):
@ECHO OFF
cls
ipconfig >> %username%.txt
ver >> %username%.txt
echo %username% >> %username%.txt
echo ********************* >> %username%.txt
And for me, it will make a text file called JOE.TXT that contained the following:
Windows NT IP Configuration
Ethernet adapterACC07D1:
IP Address. . . . . . . . . : 10.1.1.211
Subnet Mask . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . : 10.1.1.1
Windows NT Version 4.0
JMO
*********************
I added the "****" just for fun!
Now, you can have each line of the BAT write to the same file, to append all your users into one big file. (that is why the ***** are useful)
So, either add this to an existing logon script, just run it as a BAT manually, or call it from a logon script by doing a CALL NTVER.BAT from the logon script.
Hope this helps.
by joseph moore
I forgot:
The secret to appending to the same text file is the ">>". If you did a single carat, ">" it would OVERWRITE.
But the double carat, ">>" APPENDS.
Just a little old DOS syntax.
by joseph moore
Actually, the text file it made is called JMO.TXT
Sorry, I wasn't thinkin'!
by joshhansen
by billc124
by joshhansen
by faisalmasood
Joseph Moore, your script works nicely. I've used it in this way with one more option to save the computer name using HOSTNAME command.
@ECHO OFF
cls
Echo off
ipconfig >> %username%.txt
ver >> %username%.txt
hostname >> %username%.txt
echo %username% >> %username%.txt
echo The home drive is %HOMEDRIVE% >> %username%.txt
echo *************************************************** >> %username%.txt
Actually I want to use this script to track which user is logging on from which machine & which Id they are using. Actually users here are trying to access things not allowed to them using others accounts / machines.
So my only hope to track them is using this script. But this script saves the %username%.txt file in the root oof their boot partition.
Is there any way using this script to save the file on my server without giving user access to those file.
by joshhansen
by joshhansen
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending