# Perforce Edit says "%1 is not a valid Win32 application"

**URL:** https://www.finalbuilder.com/forums/t/perforce-edit-says-1-is-not-a-valid-win32-application/2830
**Category:** Bugs
**Created:** [May 14, 2007, 8:14am UTC](https://www.finalbuilder.com/forums/t/perforce-edit-says-1-is-not-a-valid-win32-application/2830 "2007-05-14T08:14:09Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![martin.lanza](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@martin.lanza](https://www.finalbuilder.com/forums/u/martin.lanza)
#### Post date: [May 14, 2007, 8:14am UTC](https://www.finalbuilder.com/forums/t/perforce-edit-says-1-is-not-a-valid-win32-application/2830/1 "2007-05-14T08:14:09Z")

</div>

I have a Perforce edit action that works fine on many VMs, but our remote developer (over VPN) gets a strange error when the action runs. FB says:   
&nbsp;&nbsp; |— Failed to execute program. Error: %1 is not a valid Win32 application  
&nbsp;&nbsp; |— Action Failed  
&nbsp;&nbsp; |— c:\program files\perforce\p4.exe returned : -998  
  
The Perforce GUIs work fine on his virtual machine, and a similar VM works fine on the local network. “p4 get” and “p4 edit” work with simple test files, so I wonder if perhaps you’re dropping a quote or something interesting? I know we have spaces in the filespec: **//depot/Code/Trunk/Projects/~FinalBuilder Scripts/…** (adding quotes makes no difference).  
  
Note that we’re running a geritric Perforce server because we’re too cheap to upgrade. So we can’t submit from FB to Perforce, for example, but edit works at least locally.

---

<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: [May 15, 2007, 1:22am UTC](https://www.finalbuilder.com/forums/t/perforce-edit-says-1-is-not-a-valid-win32-application/2830/2 "2007-05-15T01:22:30Z")

</div>

Hi Moz,  
  
If your remote developer goes to Tools -\> Options -\> Version Control Systems -\> Perforce, is the path to P4.EXE set properly?  
  
I don’t know why it would appear as “%1”, but each machine will need the path to P4.EXE set before it can be used (the error should actually be more specific.)  
  
Regards,  
  
Angus

---

<div class="post-metadata">

### Author: ![martin.lanza](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@martin.lanza](https://www.finalbuilder.com/forums/u/martin.lanza)
#### Post date: [May 22, 2007, 3:58am UTC](https://www.finalbuilder.com/forums/t/perforce-edit-says-1-is-not-a-valid-win32-application/2830/3 "2007-05-22T03:58:59Z")

</div>

Sorry for the delayed response, I’ve been waiting for the remote developer to come down here and hassle me about it. Now I have a copy of his VM and I can play with it.  
  
Yes, the path is set correctly, and what we’re seeing seems to be the result of running P4.exe with command line options that it doesn’t like. The behaviour is identical running his VM locally (no VPN).I’m experiementing at the moment to see what differences there are between the two VMs.

---

<div class="post-metadata">

### Author: ![martin.lanza](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@martin.lanza](https://www.finalbuilder.com/forums/u/martin.lanza)
#### Post date: [May 22, 2007, 4:06am UTC](https://www.finalbuilder.com/forums/t/perforce-edit-says-1-is-not-a-valid-win32-application/2830/4 "2007-05-22T04:06:14Z")

</div>

OK, Perforce itself works fine in that VM (as I’d expect, the developer uses it all the time), the Delphi plugin also works fine, it’s only FinalBuilder that’s struggling. Most confusing.

---

<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: [May 22, 2007, 7:30am UTC](https://www.finalbuilder.com/forums/t/perforce-edit-says-1-is-not-a-valid-win32-application/2830/5 "2007-05-22T07:30:11Z")

</div>

Hi Moz Moz,  
  
There aren’t quotes around the path to p4.exe in the options, are there?  
  
The error is a Windows error (coming back from CreateProcess), not a Perforce error, so it either means  
  
a) There’s a serious error in the command line we’re generating  
or  
b) The file which is pointed to as p4.exe isn’t a valid Win32 PE executable.  
  
Sounds like it’s almost certainly the former. Could you please send a couple of files to us via ‘support at [finalbuilder.com](http://finalbuilder.com)’?  
  
- The project file (.fbp5 or .fbz5)  
- The FinalBuilder5.ini file for the machine, which can be found under C:\Documents and Settings\All Users\Application Data\VSoft\FinalBuilder5 (or similar)  
  
Thanks very much.  
  
Regards,  
  
Angus

---

<div class="post-metadata">

### Author: ![martin.lanza](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@martin.lanza](https://www.finalbuilder.com/forums/u/martin.lanza)
#### Post date: [May 22, 2007, 8:55am UTC](https://www.finalbuilder.com/forums/t/perforce-edit-says-1-is-not-a-valid-win32-application/2830/6 "2007-05-22T08:55:55Z")

</div>

No quotes in the p4.exe location in FB settings, it’s literally identical to one that does actually work. I’ve emailed you.  
  
thanks  
Moz  
  
(BTW, I’m Moz Moz because your signup says “first name” then “last name” and with only one name… first=last=middle :)&nbsp; )

---

<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: [May 22, 2007, 9:12am UTC](https://www.finalbuilder.com/forums/t/perforce-edit-says-1-is-not-a-valid-win32-application/2830/7 "2007-05-22T09:12:35Z")

</div>

Hi Moz,  
  
Sorry, I typed “Moz Moz” without even thinking. I guess we use a fairly ethnocentric web site module. :).  
  
The email hasn’t shown up yet, but we have some fancy “graylisting” spam software so sometimes they get delayed for a while.  
  
- Angus

---

<div class="post-metadata">

### Author: ![martin.lanza](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@martin.lanza](https://www.finalbuilder.com/forums/u/martin.lanza)
#### Post date: [May 23, 2007, 3:36am UTC](https://www.finalbuilder.com/forums/t/perforce-edit-says-1-is-not-a-valid-win32-application/2830/8 "2007-05-23T03:36:49Z")

</div>

OK, the solution turned out to be using a shorter list of files to edit. Splitting it into two actions solved the problem.   
  
edit: For a while anyway. Now it's back even for empty filespecs.

edit again: Angus has sent me a new build that fixes the problem.
