Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Unable to run a .bat file with psexec commands

$
0
0

Hi all, so I've been trying to write a script that'll run a local .bat file.

It's a simple idea that i run a batch file from autoit using the codes below with a simple run command.

#RequireAdmin Run( 'C:\AutoTestPackage\TestSuite\SmokeTest\Configure\Temp_Basic.bat' )

Then the batch file will execute the  command line

psexec -i -d \\SGP101TEST02 -u TEST02 -p admin3t -f -c C:\AutoTestPackage\TestSuite\SmokeTest\Configure\Basic_Configuration.bat

 

 

However when i run the script below, the cmd window would appear but it gives an error saying

'psexec.exe' is not recognized as an internal or external command.

 

I also tried directly writing this in autoit

Run( @ComSpec & " /k C:\Windows\System32\PsExec.exe \\SGP101TEST02 C:\AutoTestPackage\TestSuite\SmokeTest\Configure\Temp_Basic.bat > C:\Temp\My.log")

 

But same error 
 
Can anyone tell me what was going on?
Btw if i run the .bat manually it worked!

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>