Jump to content

Recommended Posts

Posted (edited)

I need help with a DOS line I am trying to send to another computer.
I am using a program called psexec to connect to another computer on my domain and perform a cmd-command on that computer remote.
The software works great, but when I try to automate this and put both commands in 1 line it wont work

example:
psexec hostname cmd
(this starts the service and after 5-10 seconds it is ready)

then I want it to do this command after loading is done:
net localgroup administrators username /add

but when I try these two commands together it wont start the second command. both & and && wont work.

Kind Regards,
Akarillon

Edited by Jon

Challenge accepted!

Posted

cmd is the human interface. You don't have to run cmd to be able to run commands. Example:

psexec \\hostname net localgroup administrators username /add

But, you can use cmd to run commands anyway, like this:

psexec \\hostname cmd /c net localgroup administrators username /add

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...