runas command in a bat file

G

Guest

I have a bat file that runs on logon. I am not using GP for this but our
logon software. The problem is that in order for the bat file to work, it
needs admin rights. Can anyone tell me if there is a way to add the runas
command to a bat file.
Thanks for the help
 
R

Roland Giesler

Stacy said:
I have a bat file that runs on logon. I am not using GP for this but our
logon software. The problem is that in order for the bat file to work, it
needs admin rights. Can anyone tell me if there is a way to add the runas
command to a bat file.
Thanks for the help

Have a look at the SrvAny command available as a download from MS. It
allows any program, including batch files (invoked with cmd /c) to run as a
server and also set the user it should run as.

Roland
 
G

Guest

Thanks, but that is not what I am looking for. the bat file makes changes to
the winnt folder and since my users are not admins, the bat file fails. It
does however work if it is run under admin rights. Considering I have to run
this on over 300 machines, I am trying to avoid going to each one myself.
 
R

Roland Giesler

Stacy said:
Thanks, but that is not what I am looking for. the bat file makes changes
to
the winnt folder and since my users are not admins, the bat file fails.
It
does however work if it is run under admin rights. Considering I have to
run
this on over 300 machines, I am trying to avoid going to each one myself.

I don't think there is an easy way to get past this, unless you have a
domain and use a policy to do this? If not, running the btach file as a
service will do exactly what you want and terminate on completion...

Maybe if you describe more accurately what you are trying to do, we could
help a little more?

regards

Roland
 
3

3c273

You might have a look at "psexec" from www.sysinternals.com. It is part of
their free "pstools", an excellent collection of command line utilities. It
does exactly what you want and will even run commands remotely. HTH.
Louis
 
G

Guest

I have a bat file that removes the games from a pc. I have it written in a
vbs script as well. I have tried running as a script and a bat file but the
commands must have admin rights to complete.
I am searching for a way to excute this without have to go to every pc and
manually do it.
 
G

Guest

Thanks,
That seems to be working for me

3c273 said:
You might have a look at "psexec" from www.sysinternals.com. It is part of
their free "pstools", an excellent collection of command line utilities. It
does exactly what you want and will even run commands remotely. HTH.
Louis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top