Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute a command (TortoiseHG) through cmd remotely (PsExec)

Basically I want to use PsExec in order to navigate to a specificar folder in a remote computer and performe "hg update branch". I've tried to create the following batch but I'm not able to perform the command:

psexec cmd.exe /c "cd C:\Project\hg update Test"

It's reading as the "hg update Test" was a folder instead of command to be done... I'm tilting over here and this seems like a basic thing :(. How do I pass the "hg update branch" as cmd command through PsExec?

like image 477
kenzoviski Avatar asked Dec 05 '25 10:12

kenzoviski


1 Answers

You don't need to change directory, just tell HG what path to operate in:

psexec cmd.exe /c "hg update -R C:\Project\ Test"

The help says:

 -R --repository REPO   repository root directory ...
like image 127
StayOnTarget Avatar answered Dec 09 '25 17:12

StayOnTarget



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!