Computing.Net > Forums > Windows XP > Auto Login Batch File

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Auto Login Batch File

Reply to Message Icon

Name: ratikal
Date: November 6, 2009 at 06:46:02 Pacific
OS: Windows XP
CPU/Ram: Varies
Subcategory: Configurations
Tags: XP, batch, login, script
Comment:

I need to constantly log on many computers to configure/install/do whatever. Is there anyway I can backdoor (\\compname\c$) and make a batch file so it'll sign me on when I start the computer up? If this is possible, what would the batch commands be? My only options are using notepad so I can't use any of this fancy software I've heard remarked through these forums.

Thank you.



Sponsored Link
Ads by Google

Response Number 1
Name: ace_omega
Date: November 6, 2009 at 06:54:50 Pacific
Reply:

The answer is NO you can not do it with batch scripting because it would be a security risk to allow this. You could probably do it with VB Script. If you are not open to installing a developed backdoor then you have no options.

The solution we came up with is a Service that my programmer made that would check a SQL Server Schedule where we could pass deployment commands to. Then we installed this on every computer.

There are third party apps that will do this for you like...

http://www.softlist.net/program/rem...

but we preferred to install our own application because running third party apps could be revers engineered and have exploits.


0

Response Number 2
Name: ratikal
Date: November 6, 2009 at 07:18:25 Pacific
Reply:

Thank for the quick response. But, there would't be a way to make a batch file run when a computer connects to a domain (when it first turns on) would there? My main purpose right now is to run another batch file to get MAC Addresses and write them to a txt file.

Nevertheless, thanks for the help and I'm gonna show that program to my boss.


0

Response Number 3
Name: ace_omega
Date: November 6, 2009 at 12:40:24 Pacific
Reply:

Well of course you can run a Batch file when people login. Just go into the GPO and setup a Logon Script. The problem is there is no RUNAS that will work in a batch file. You can only use RUNAS at the command prompt because you have to give it the user name and password. If the users do not have rights to install applications on their computers then you will need something that will run the apps with elevated rights.

As for logging, I use this script in my login scripts...

call \\10.100.100.7\scripts\mapdrives.vbs
ADDPRINTERCONNECTION ("\\10.100.100.8\Fax")

echo ************************************** >> \\10.100.100.8\share\loginlog.txt
echo Logon %computername% %username% >> \\10.100.100.8\share\loginlog.txt
date /t >> \\10.100.100.8\share\loginlog.txt
time /t >> \\10.100.100.8\share\loginlog.txt
echo ************************************** >> \\10.100.100.8\share\loginlog.txt

You could modify it to do ...

@echo off
setlocal
for /f "delims=" %%a in ('ipconfig /all') do call :next "%%a"
goto :wrtielog

:next
if "%~1"=="Ethernet adapter Local Area Connection:" set NIC=1
for /f "tokens=1-3 delims=:. " %%b in (
"%~1") do call :next2 "%%b" "%%c" "%%d"
goto :wrtielog

:next2
if "%NIC%"=="1" if "%~1"=="Physical" if "%~2"=="Address" (set MAC=%~3&set NIC=0)

:wrtielog
echo ************************************** >> \\10.100.100.8\share\loginlog.txt
echo Logon %computername% %username% >> \\10.100.100.8\share\loginlog.txt
echo %MAC% >> \\10.100.100.8\share\loginlog.txt
date /t >> \\10.100.100.8\share\loginlog.txt
time /t >> \\10.100.100.8\share\loginlog.txt
echo ************************************** >> \\10.100.100.8\share\loginlog.txt

Don't forget you have to change My IPs with yours. I would alos suggest you put the loop that extracts the MAC from the IPCONFIG /ALL in a seperate batch file and call it like I did with my map drives script in the first example I gave you.


0
Reply to Message Icon

Related Posts

See More


ethernet controll driver Help! My Hard Disk Failed...


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Auto Login Batch File

Auto folder Batch file www.computing.net/answers/windows-xp/auto-folder-batch-file/145055.html

Auto-run batch file to system error messages www.computing.net/answers/windows-xp/autorun-batch-file-to-system-error-messages/175672.html

How do I Auto run batch file Every 60 minute www.computing.net/answers/windows-xp/how-do-i-auto-run-batch-file-every-60-minute/179011.html