Jump to content

help please! Batch file help!


shadowfla

Recommended Posts

hi everyone, i need some help making a batch file in win xp pro sp1

the following code is in the batch file, basically it is starting freeenc.exe which is an encoder , and the text that comes after freeenc.exe is supposed to be the switches that i want to use with freenc, and yes they are the right switches for the program. The problem is when i run this, windows gives me a File Not Found error

this is my first time writing a batch file, im pretty sure i got the syntax wrong or something like that,...please anyone help?

start /wait "C:\Program Files\DIKO\FreeEnc\FreeEnc.exe /i "C:\finals\scripts\11.avs" /o "C:\finals\mpvs\11.mpv" /2 /b 2000 /aspectratio 4:3 /gopsize 18  /maxbitrate 4000 /priority 5 /dc 8 /mpeg2 /scene /extreme /maxbframes 2 /kvcd /auto /close

Link to comment
Share on other sites


I don't know why people are always use start /wait when call is doing the same job.

Maybe someone could post me the reason why...

@shadowfla: For your batch try this command (you forgot a quote at the end of freeenc.exe)

start /wait "C:\Program Files\DIKO\FreeEnc\FreeEnc.exe" /i "C:\finals\scripts\11.avs" /o "C:\finals\mpvs\11.mpv" /2 /b 2000 /aspectratio 4:3 /gopsize 18  /maxbitrate 4000 /priority 5 /dc 8 /mpeg2 /scene /extreme /maxbframes 2 /kvcd /auto /close

And if it don't work, try this one

CALL "C:\Program Files\DIKO\FreeEnc\FreeEnc.exe" /i "C:\finals\scripts\11.avs" /o "C:\finals\mpvs\11.mpv" /2 /b 2000 /aspectratio 4:3 /gopsize 18  /maxbitrate 4000 /priority 5 /dc 8 /mpeg2 /scene /extreme /maxbframes 2 /kvcd /auto /close

Make sure that

11.AVS is in C:\finals\scripts

11.mpv is in C:\finals\mpvs

-----------

Link to comment
Share on other sites

From the type of error you get it seems like the command interpreter takes one of the parameters as the name of a file, and, not finding it, gives the error.

You COULD try something like the following:

SET COMMAND1="C:\Program Files\DIKO\FreeEnc\FreeEnc.exe"
SET PARAM1=/i
SET COMMAND2=C:\finals\scripts\11.avs
SET PARAM2=/o
SET COMMAND3=C:\finals\mpvs\11.mpv
SET PARAM3=/2 /b 2000 /aspectratio 4:3 /gopsize 18  /maxbitrate 4000 /priority 5 /dc 8 /mpeg2 /scene /extreme /maxbframes 2 /kvcd /auto /close

start /wait %COMMAND1% %PARAM1% %COMMAND2% %PARAM2% %COMMAND3% %PARAM3%

::Clear up Environment Variables used
SET COMMAND1=
SET PARAM1=
SET COMMAND2=
SET PARAM2=
SET COMMAND3=
SET PARAM3=

and partialize it to understand which part causes the error.

Though seemingly more complex, this way it makes it easier to change paths to the files.

Please note that you only need quotes in the COMMAND1 string as there is a space between 'Program' and 'Files'

jaclaz

Link to comment
Share on other sites

I don't know why people are always use start /wait when call is doing the same job.

Maybe someone could post me the reason why...

Actually it doesn't do the same job. I haven't looked into it deeper, but I never use start /wait and I never have problems. (just like we don't *have* to use msiexec.exe to launch .msi's I guess?). The only time you really need to use CALL is if you're launching another batchfile. If you omit call, the 2nd batchfile won't return.

Link to comment
Share on other sites

thanks everybody for the fast response,

jdoe both of your ideas didnt work, i had tried putting that " mark before and it didnt help

jaclaz is right though , its as if command interpreter thinks that one of the parameters is a file name. Ill try your idea jaclaz tommorow ASAP

thanks alot all!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...