# PSexec issue in FinalBuilder 5

**URL:** https://www.finalbuilder.com/forums/t/psexec-issue-in-finalbuilder-5/2719
**Category:** Bugs
**Created:** [November 29, 2006, 1:32am UTC](https://www.finalbuilder.com/forums/t/psexec-issue-in-finalbuilder-5/2719 "2006-11-29T01:32:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nelsonwolf](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/b9e5f3/32.png) [@nelsonwolf](https://www.finalbuilder.com/forums/u/nelsonwolf)
#### Post date: [November 29, 2006, 1:32am UTC](https://www.finalbuilder.com/forums/t/psexec-issue-in-finalbuilder-5/2719/1 "2006-11-29T01:32:39Z")

</div>

Hi,I have found an issue with using PsExec Action in Final Builder 5. If you have a Run Script action that executes some vbscript code before psexec action then the psexec action errors out when running with fbcmd. It’s very easy to replicate, just create a simple project put two actions there:1. Run Script Action (Put some simple vbscript code there)2. PsExec Action: Make it do some simple stuffRun the project with fbcmd.exe and see it fail.

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [November 29, 2006, 5:55am UTC](https://www.finalbuilder.com/forums/t/psexec-issue-in-finalbuilder-5/2719/2 "2006-11-29T05:55:30Z")

</div>

Hi Eugene,  
  
This works fine for me, and there really is no reason why two actions should affect each other in this way. Are you sure you haven’t accidentally slipped some script into the BeforeAction event of the PsExec action?  
  
If you haven’t, could you please send the FinalBuilder project to [support@finalbuilder.com](mailto:support@finalbuilder.com) for us to have a look at?  
  
Thanks.  
  
- Angus

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [November 30, 2006, 12:11pm UTC](https://www.finalbuilder.com/forums/t/psexec-issue-in-finalbuilder-5/2719/3 "2006-11-30T12:11:31Z")

</div>

Hi Eugene,  
  
Thanks for sending the project. I emailed you a fix, but I’m including the reply here for completeness.  
  
\*\*\*  
  
Thanks for sending the project. I was wrong, the VBScript was messing up the Psexec action!  
  
Due to the way the psexec process buffers output, the Psexec action actually uses your temporary directory to store a temporary file with psexec output.  
  
Your script was inadvertantly overwriting the Temp environment variable with an invalid directory.  
  
Adding the line  
  
dim temp  
  
to the top of the script is sufficient to make it work (this defines Temp as an explicit local variable. Just using a variable called Temp gives you the global TEMP environment variable.)  
  
I’ll modify the Psexec action so it checks first if the TEMP directory exists. However, if you’re using a variable called “temp” in script then I strongly recommend you declare it first with either ‘dim’ (VBScript) or ‘var’ (JScript) to avoid unexpected behaviour.  
  
\*\*\*
