Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good Morning,
i am trying to run a VB Script file on a remote host and trigger the exectution of this script by a Supporting Task in Publisher.
When i run the invoke command call from my own local PC it works as it should:
invoke-command -asjob -computer REMOTE_HOST -scriptblock { cscript.exe "D:\VBScripts\test_2.vbs" }
But the same command executed from a Supporting Task in Publisher fails with this error:
(2016-07-07 09:25:23) Error: Exception=System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified || at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) || at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) || at SolutionGlobal.DOSExecute.ExecuteCommand(ILogBucket i_LogBucket, String i_Command)
(2016-07-07 09:25:23) Error: The process didn't start
Any idea how i can make this work - or any other approach that makes this work is greatly appreciated.
Thanks in advance!
The user which run the publisher might not have the proper access rights to these file. Also the path might be a problem and replaced with an unc-path or maybe the drive mounted with a net use statement.
- Marcus
The user which run the publisher might not have the proper access rights to these file.
It should, as Publisher also distributes to this location.
Also the path might be a problem and replaced with an unc-path or maybe the drive mounted with a net use statement.
Tried that. Made no difference.
Any other idea how i can get this to work maybe ?
Maybe there is any security-setting which need to be enabled like it is within the user-profil in tab security to allow the execution of scripts.
- Marcus
You may want to tell the Publisher that it should use ps to run this command. Add the full path to the ps executable.
Peter
Thanks! How would that path fit into the call i mentioned in my initial post ?
invoke-command -asjob -computer REMOTE_HOST -scriptblock { cscript.exe "D:\VBScripts\test_2.vbs" }
See the -Command option here: PowerShell.exe Command Line Help