Make a shortcut "Run as" someone else...

PainlessTorture

Official Best Member
Vista Pro
Hey,

Does anyone know how I can make a shortcut open a command prompt as another user with just one click? I have the credentials its just I have to be able to do it as fast as possible so maybe just clicking on something that automatically "Runs as" the user who's credentials I set it to.

I can not use the following;
  • .bat
  • .exe
  • .cmd
  • .reg
Or anything else that could be blocked by a software restriction policy in a school.

Thanks.
 

My Computer

System One

  • Manufacturer/Model
    Hewlett Packard
    CPU
    3.40Ghz / 2.20Gz Duo Core
    Memory
    2GB / 3GB
    Hard Drives
    160 GB / 160 GB
You were so close! Its "RUNAS" ;)
Code:
C:\>runas
RUNAS USAGE:

RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]
        /user:<UserName> program

RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]
        /smartcard [/user:<UserName>] program

RUNAS /trustlevel:<TrustLevel> program

   /noprofile        specifies that the user's profile should not be loaded.
                     This causes the application to load more quickly, but
                     can cause some applications to malfunction.
   /profile          specifies that the user's profile should be loaded.
                     This is the default.
   /env              to use current environment instead of user's.
   /netonly          use if the credentials specified are for remote
                     access only.
   /savecred         to use credentials previously saved by the user.
                     This option is not available on Windows Vista Home or Windo
ws Vista Starter Editions
                     and will be ignored.
   /smartcard        use if the credentials are to be supplied from a
                     smartcard.
   /user             <UserName> should be in form USER@DOMAIN or DOMAIN\USER
   /showtrustlevels  displays the trust levels that can be used as arguments
                     to /trustlevel.
   /trustlevel       <Level> should be one of levels enumerated
                     in /showtrustlevels.
   program         command line for EXE.  See below for examples

Examples:
> runas /noprofile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:[email protected] "notepad \"my file.txt\""

NOTE:  Enter user's password only when prompted.
NOTE:  /profile is not compatible with /netonly.
NOTE:  /savecred is not compatible with /smartcard.
 

My Computer

Yes I know how to do it, im asking is there a way to do it in one click?

For eg, Click on "Run cmd as user2" to run as user 2 instead of having to do cmd > "runas /user user2 cmd"

Would a shortcut to runas with arguements work?
 

My Computer

System One

  • Manufacturer/Model
    Hewlett Packard
    CPU
    3.40Ghz / 2.20Gz Duo Core
    Memory
    2GB / 3GB
    Hard Drives
    160 GB / 160 GB
I made a shortcut to "C:\Windows\System32\runas.exe /user admin3 cmd"

But when I run it I get the message that comes with a syntax error and then it closes. Any ideas?
 

My Computer

System One

  • Manufacturer/Model
    Hewlett Packard
    CPU
    3.40Ghz / 2.20Gz Duo Core
    Memory
    2GB / 3GB
    Hard Drives
    160 GB / 160 GB
Its not an error, its just the thing that comes up when you type "runas /?"
 

My Computer

System One

  • Manufacturer/Model
    Hewlett Packard
    CPU
    3.40Ghz / 2.20Gz Duo Core
    Memory
    2GB / 3GB
    Hard Drives
    160 GB / 160 GB
Hmm try running it from the command prompt... It should look something like this:

Code:
C:\>runas /user:shao notepad
Enter the password for shao:
Attempting to start notepad as user "ADMIN06\shao" ...
 

My Computer

Got it, thanks.

I typed ; instead of :

Thank you for your help :)
+Rep
 

My Computer

System One

  • Manufacturer/Model
    Hewlett Packard
    CPU
    3.40Ghz / 2.20Gz Duo Core
    Memory
    2GB / 3GB
    Hard Drives
    160 GB / 160 GB
Erm...Just one last thing, is there a way to put the password in the shortcut so it does not ask you for it?
 

My Computer

System One

  • Manufacturer/Model
    Hewlett Packard
    CPU
    3.40Ghz / 2.20Gz Duo Core
    Memory
    2GB / 3GB
    Hard Drives
    160 GB / 160 GB
How does /savecreds work?

"runas /user:admin3 /savecred (password) cmd"?
 

My Computer

System One

  • Manufacturer/Model
    Hewlett Packard
    CPU
    3.40Ghz / 2.20Gz Duo Core
    Memory
    2GB / 3GB
    Hard Drives
    160 GB / 160 GB
Just use: "runas /user:admin3 /savecred cmd"

The first time it runs it will prompt for the password, and it will save it, so after that it won't ask again.
 

My Computer

Just use: "runas /user:admin3 /savecred cmd"

The first time it runs it will prompt for the password, and it will save it, so after that it won't ask again.

Will it ask for the password if I change station and/or logoff?
 

My Computer

System One

  • Manufacturer/Model
    Hewlett Packard
    CPU
    3.40Ghz / 2.20Gz Duo Core
    Memory
    2GB / 3GB
    Hard Drives
    160 GB / 160 GB
Once its saved its saved and will work until the password changes, don't matter if you logoff/reboot etc.

I cant get it to save, what will I type in? Can you give an example please?

Just to clarify, will this allow any user to use "run as" with my credentials or will it be saved to my account?
 

My Computer

System One

  • Manufacturer/Model
    Hewlett Packard
    CPU
    3.40Ghz / 2.20Gz Duo Core
    Memory
    2GB / 3GB
    Hard Drives
    160 GB / 160 GB
Just run the command I gave you and it will only prompt you for the password the first time. It is saved to your account so other uses won't be able to use it.
 

My Computer

Back
Top