Link to home
Start Free TrialLog in
Avatar of Rajesh Nayyar (CISSP, CCSP)
Rajesh Nayyar (CISSP, CCSP)Flag for United States of America

asked on

Logging into Administrator account using a batch file?

Ok, here is the deal:

I have a computer running Windows XP Professional SP2 which is a touch screen - and it automatically logs into a restricted user account which has limited capability, and an on screen keyboard to run searches or browse a program's menu.

In order to make any changes to this system, I would need to log into the Administrator account by plugging in a keyboard and repeatedly tapping shift to bypass the auto login to the restricted user account. This however is providing to be a bit time consuming, as the process can be hit or miss, resulting in the need to reboot the computer, and try again until you get the login prompt.

In the user account, privileges to command prompt and auto run (i.e: automatically run a CD or USB drive when it is plugged in) are left open for certain functions to operate. My question is this:

Is it possible to create a batch file which can be executed from a USB drive using an "autorun.ini" file so that upon plugging it into this computer, it logs out of the user account, and logs you directly into the Administrator account without the need to reboot?.

If not, are there other methods to do this efficiently without having to use the a fore mentioned method?

Thank you in advance!
ASKER CERTIFIED SOLUTION
Avatar of apache09
apache09
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of OriNetworks
OriNetworks

if you perform a task repeatedly, you could look at a batch file to run the program or command using the runas command but this will require storing the password.
You can use runas command and open a IE and type the drive letter of USB in the IE browser.

runas /user:domain\admin_test  "C:\Program Files\Internet Explorer\iexplore"
or you can use the below utility which would help you between switching to a restricted account and a admin account.
http://www.stefan-kuhr.de/supsu/main.php3 
hi,
if you need admin acces you can start a command prompt with admin credentials after startup using run as
(right click cmd.exe and click run as, use your admin credentials), afterwards any program you start from that command prompt will be started with admin credentials.
Avatar of Rajesh Nayyar (CISSP, CCSP)

ASKER

To give you an idea of what I had been working on:

I used PSTools:
http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx

And created a batch file which utilized the PsShutdown command with the parameters necessary to logoff the user. Then I created an autorun file which pointed to the batch file I created. This effectively created a USB drive which, when plugged in, logged off the current user.

The problem I'm running into now is that after logging off, it doesn't automatically redirect to the Administrator account. I'm assuming there isn't any possibility of adding an extended command to put into the batch file which loads credentials necessary to login to the Administrator account?.

Also, the runas method which was mentioned, though a very solid suggestion, unfortunately does not meet the needs I have for the system in question.
did you look into the utility that I mentioned.You don't need to logoff to switch between users account with the utility that I mentioned.