# Calling batch files with spaces in the name

**URL:** https://www.finalbuilder.com/forums/t/calling-batch-files-with-spaces-in-the-name/2851
**Category:** Bugs
**Created:** [June 11, 2007, 10:06am UTC](https://www.finalbuilder.com/forums/t/calling-batch-files-with-spaces-in-the-name/2851 "2007-06-11T10:06:02Z")
**Posts on this page:** 6
**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: [June 11, 2007, 10:06am UTC](https://www.finalbuilder.com/forums/t/calling-batch-files-with-spaces-in-the-name/2851/1 "2007-06-11T10:06:02Z")

</div>

This is a bit interesting, at least - if your batch file has spaces in the name, you need two double quotes at each end in order to run it:

The parameter needs to be""My Batch File.bat"" rather than "My File.bat" or even my file.bat

&nbsp;

Can we count this as a bug, at least we should get a warning or hint that filenames with spaces need to be treated specially?

&nbsp;

thanks

Moz

&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: [June 12, 2007, 1:43am UTC](https://www.finalbuilder.com/forums/t/calling-batch-files-with-spaces-in-the-name/2851/2 "2007-06-12T01:43:55Z")

</div>

Hi Moz,   
  
 That’s a bug. Thanks for reporting it. Are you using the Run DOS Command action to run the batch file?   
  
 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: [June 12, 2007, 3:12am UTC](https://www.finalbuilder.com/forums/t/calling-batch-files-with-spaces-in-the-name/2851/3 "2007-06-12T03:12:09Z")

</div>

yes, run DOS command with ““my batch file.bat”” as the command and a “start in” directory specified. I’m also having to say “program exit code must me 0” which I’d like to see as the default. But that’s a “wish list” not a bug.

---

<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: [June 12, 2007, 6:07am UTC](https://www.finalbuilder.com/forums/t/calling-batch-files-with-spaces-in-the-name/2851/4 "2007-06-12T06:07:24Z")

</div>

Hi Moz,   
  
 The latest FB 5 test build will run multi-word batch files properly. It will only work if you’re not passing any command line arguments to the file. If you’re passing arguments, you’ll need to do the quoting manually (or not have spaces in the batch file name.)   
  
 You can get the build here: [https://www.finalbuilder.com/downloads/finalbuilder/550/FB550\_265.exe](https://www.finalbuilder.com/downloads/finalbuilder/550/FB550_265.exe)   
  
 Regards,   
  
 Angus   
  
 PS The “program exit code must be” function is turned off by default because, despite the fact that 90% of Windows programs respect the zero-as-success model of exit codes, 10% do not.

---

<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: [June 12, 2007, 7:01am UTC](https://www.finalbuilder.com/forums/t/calling-batch-files-with-spaces-in-the-name/2851/5 "2007-06-12T07:01:34Z")

</div>

Cool. Thanks heaps for that, the usual very fast turn-around on bugs is great!

&nbsp;

As for the program exit code... there's always one

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [June 13, 2007, 6:29am UTC](https://www.finalbuilder.com/forums/t/calling-batch-files-with-spaces-in-the-name/2851/6 "2007-06-13T06:29:21Z")

</div>

How about an option to set that “exit code must be 0” as default? I’ve been caught a couple of times.   
  
 Steve
