kenzoviski
kenzoviski

Reputation: 91

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?

Upvotes: 3

Views: 39

Answers (1)

StayOnTarget
StayOnTarget

Reputation: 12988

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 ...

Upvotes: 2

Related Questions