Problems with PsExec - Run Command
Hello!
I have a collection with several computers.
All the computers have a .bat file on a specific folder (C:\install\<foldername>\) which I want to be executed/run.
I'm trying to use the "Tools" -> "Run Command" feature in PDQ Inventory (Free version 18.4.00)
In the run command I try to use this command line:
PsExec.exe cmd.exe /c "C:\Install\<foldername>\<nameoffile.bat>"
I get the following error in the output window:
'PsExec.exe' is not recognized as an internal or external command, operable program or batch file.
The PSTools are downloaded and extracted in the C:\windows\system32\ folder. PsExec.exe is located in that folder.
I know that psexec.exe works if i use PsExec in cmd.
I have also tried: cmd.exe "C:\Install\<foldername>\<nameoffile.bat>"
But then I get no error except I get a timeout after 180 seconds. I tried to set the timeout to 360 also, Same result.
Not that it's relevant, but for info, the .bat file I want to execute, runs several commandoes (Wmic) and based og the result of the Wmic commando, it desides wether an application gets uninstalled or not.
Comments
Tools are Remote by default (and Free mode only has access to Remote), which means that the commands are executed on the target, not the computer running Inventory. This command should work for you: CALL "C:\Install\<foldername>\<nameoffile.bat>"