PDA

View Full Version : Help with running a batch file with an ampersand in file path...



Cortexian
April 8th, 2011, 11:07 PM
So I've got this Batch Transcoding batch file that came with Badaboom 2.0 to transcode an entire folder of videos into iPhone format but I'm having a problem. The batch file won't execute because it cannot find the specified file, I've tracked this down to the fact that there's an ampersand (&) in one of the file paths I've specified. See below:


@echo off
REM ************************************************** ****
REM This will be the directory where your video files are
REM awaiting transcode. An example is provided here, but
REM will need to be changed to your source folder location.
REM ************************************************** ****
set SOURCE=D:\Media\Movies & TV\Star Trek\04 Star Trek Voyager\Season 1

REM ************************************************** ****
REM Set this as the directory where all your output files
REM will be written. Again, an example is provided.
REM ************************************************** ****
set DEST=C:\Users\Kevin\Videos\iPhone

Is there some kind of alternative to the ampersand sign that I can use that the batch file will recognize? I read online that escaping the ampersand like this "^&" would make it work, however that appears to not be the case... Help!

dark navi
April 9th, 2011, 12:04 AM
Put quotes around the path.


set SOURCE="D:\Media\Movies & TV\Star Trek\04 Star Trek Voyager\Season 1"

Amit
April 9th, 2011, 12:33 AM
Would using the '+' symbol work? (only if navi's method doesn't work)

Cortexian
April 9th, 2011, 01:09 AM
Tried quotes right away, doesn't work because this batch file calls on another batch file which places the path specified here in a variable or something.

Using a + symbol might work if I were to change the actual directory to that as well, as it stands I can't because it's basically constantly in use on my PC. Not to mention, I like the &.

Kornman00
April 9th, 2011, 12:47 PM
1) Separate TV from Movies so they both have their own directory
2) Feel better knowing you have a better folder layout
2) Batch your heart out

Dwood
April 9th, 2011, 01:47 PM
Rename folder so instead of & use + or 'and'

Cortexian
April 9th, 2011, 05:06 PM
1) Separate TV from Movies so they both have their own directory
2) Feel better knowing you have a better folder layout
2) Batch your heart out
Having both in the same folder is required for the way I've organized everything.

Kornman00
April 9th, 2011, 05:53 PM
That's OK, even the Wright brothers didn't get their plane designs right the first time.

If you're so hard-on with using your current organization, just rename the folder to Video or, if that doesn't float your Canadian boat, CommercialVideo. Done.

Timo
April 9th, 2011, 07:44 PM
Use 'and' instead of &?

Cortexian
April 9th, 2011, 10:55 PM
Meh, just changed it to Movies + TV and that seems to work fine.

Korn, organization is handled on my PC via XBMC and on my PS3/Home Theater by PS3 Media Server. The actual file structures themselves don't matter for organization. Not to mention I just use Windows search to find what I'm looking for instantly in the Media folder when I need to find something specific. Heck, I could dump all the files in there without any kind of organization lol.

Patrickssj6
April 10th, 2011, 03:24 PM
That's OK, even the Wright brothers didn't get their plane designs right the first time.

If you're so hard-on with using your current organization, just rename the folder to Video or, if that doesn't float your Canadian boat, CommercialVideo. Done.

Heh you'll love me then


D:\My Videos\Movies\Commercial Movies
...
D:\My Videos\TV Shows\South Park:iamafag:

Euro: @Lancer

I just tried some things. Remove the echo for instance. Otherwise read hur (http://cypressor.twoday.net/stories/4480453/).