Friday, December 11, 2009

Running cmd.exe as SYSTEM on Win 7 and Vista

In Windows, being Administrator has its limitations. Running as SYSTEM is all powerful. It is kind of like being root in the UNIX world except you can just su or sudo to SYSTEM.

I have this lib that can run in kernel mode and in user mode. I would like to simulate a UM process using the lib doing the same things I would have it do in KM tp measure the performance difference. To solve this issue, I need to run the process as SYSTEM.

A while back, I remember doing exactly that in a sysintenrals class. I ran across this blog post that reminded me how to do it.

1. Download the sysinternals PSTools
2. Copy the files to somewhere in your path
3. In an admin cmd.exe run > psexec -i -s cmd.exe

That is it. Anything you run in the shell will be run as LOCAL SYSTEM.

No comments:

Post a Comment