Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Problems executing Powershell Script from Workflow

Updated: 22 May 2010 | 4 comments
sgreer2002's picture
0 0 Votes
Login to vote

I have a VBscript that runs in a workflow using the execute batch file component.  Within the VBscript I use the following line to execute a small powershell script.

Set objShell = CreateObject("Wscript.Shell")
objShell.Run("powershell.exe -noprofile -command D:\temp\DataAreaCreate.ps1" & " " & "'" & DataArea & "'" & " " & readDL & " " & updateDL)

The VBscript runs fine without the Powershell script when pubished.  When I run the vbscript in debug mode and call the Powershell script it executes fine.  The problem I have is when I Publish the workflow - the Powershell Script fails to execute and there is no exception fired off.

So it works fine in Debug mode but not when Published.

Anyone have any ideas?

discussion Filed Under:

Comments

reecardo's picture
04
Nov
2009
0 Votes 0
Login to vote
sgreer2002's picture
03
Nov
2009
0 Votes 0
Login to vote

Nope

This is the same workflow.  The vbscripts execute flawlessly.  The same VBscript calls powershell and works great in debug.  Powershell is the only thing that fails when Published.

reecardo's picture
03
Nov
2009
1 Vote +1
Login to vote

Just curious... can you

Just curious... can you supply the full path to the powershell.exe in the command line (i.e. "C:\woo hoo\powershell.exe" -noprofile ... ) ? Or add the path to power shell in the system paths of the machine?

sgreer2002's picture
03
Nov
2009
0 Votes 0
Login to vote

Wow - Such a simple solution.

I was looking to hard!  Thanks reecardo!  I put the full path in the script to the powershell executable and voila!  Issue if fixed when published.