Having issue while executing batch file with Ranorex

Ask general questions here.
ziasim
Posts: 43
Joined: Wed Dec 16, 2015 4:03 pm

Having issue while executing batch file with Ranorex

Post by ziasim » Tue May 24, 2016 3:43 pm

Hi,

I have created a batch file which have command to execute power shell script on remote machine using PSExec. If I execute this batch file as standalone it works fine, started powershell script on remote machine and do its job.

My interest is to run this file using Ranorex. But when I try to start it via Ranorex as Run Application action item, it opened command prompt but gives an error that PSExec is not recognized as an internal or external command.

Here is the command I am using to run powershell script on remote machine using PSExec

psexec -i -d \\<machineName> -u <userNaem> -p <Password> powershell -noexit "C:\Users\Administrator\Desktop\AutomatedTestData\Scripts\RevertWin7Snapshot.ps1"


Any help would be highly appreciated..........?

Thanks

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3945
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Having issue while executing batch file with Ranorex

Post by odklizec » Wed May 25, 2016 11:04 am

Hi,

Have you tried to set the working directory to psexec (in Run application command)? Also, make sure you run your test with admin rights.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

ziasim
Posts: 43
Joined: Wed Dec 16, 2015 4:03 pm

Re: Having issue while executing batch file with Ranorex

Post by ziasim » Wed May 25, 2016 3:50 pm

Hi,

Tried to run batch script by setting working directory to PSExec lcoation but no luck. I am already running test with admin rights.

Any other guess..?

User avatar
RobinHood42
Posts: 240
Joined: Fri Jan 09, 2015 3:24 pm

Re: Having issue while executing batch file with Ranorex

Post by RobinHood42 » Fri May 27, 2016 1:36 pm

Hi,

Did you already google the error message?
I found a lot of postings in e.g. stackoverflow forum discussing this topic the same error.
I hope you find a solutin there.

Cheers,
Robin