View Full Version : A primitive question about batch file
simam3k95
22nd February 2004, 14:30
I'm burning multiple movies on a dvd that has their own folders, like movie1, movie2...etc.. MPC is in \Player folder. How can I set the path for the mplayerc.exe using relative drive letter (since I don't know the cd/dvd drive letter on other computers)?
To start the application, I used:
START ..\PLAYER\MYPLAYER.EXE "..\movie1\assets\movie1.avi" /play /fullscreen /close
which works fine when I click on the .bat file that resides in movie1 folder. But when I tried to access it from the web page, I received an error saying that windows cannot find ..\PLAYER\MYPLAYER.EXE
So, how can I set the path correctly for this to work?
Thanks in advance.
Pyscrow
22nd February 2004, 21:12
You could always add your player into the path of the computer it is to be played on - the old "path=" (cant remember syntax), but that might be considered rude by potential users!
simam3k95
22nd February 2004, 21:21
Thanks for your reply.
Can I use the PATH statement without any absolute drive letter since I'm trying to use it on different computers which has different drive letter assigned for their cd/dvd roms?
Thanks again.
gircobain
22nd February 2004, 21:52
For any file you should use the following syntax:
.\path\file
.\ points to root referent to the current path, thus allowing you to access the file regardless of which letter is assigned to the drive it is actually located. Of course that shall the full path contain any spaces, enclose it within quotes.
simam3k95
22nd February 2004, 22:54
Thanks for your suggestion.
I've tried as you mentioned but no result. It seems like the PATH statement has no effect. The error shows the path from the START statement. I have this bat file linked to a test web page which will be burnt on dvd. When I click on the bat file from the explorer it works just fine but when I invoke it through the web page it throws up the error. Finally the bat file looks like this:
PATH ./PLAYER/MYPLAYER.EXE
START ../PLAYER/MYPLAYER.EXE "..\movie1\assets\movie1.avi" /play /fullscreen /close
For the PATH statement I've experimented with both types of slashes.
Thanks again.
avih
22nd February 2004, 23:24
under dos (and batch files), you should use the backslashes ('\\').
in links, you should use the forward slash ('/').
the root path from a dos batch file would therefore be '\\'. and if you have a file called mplayer.exe at directory 'player' from the root, then you should do
start \player\mplayer.exe <the rest of your switches here>
you will probably want to use a path that's relative to the root (as demonstrated above) since you can't be sure of the default execution directory for your batch file.
to find the exact file from the html page you could either use a relative path or a relative to the root path. i would recommend the latter. this would be either
<a href="/player/play.bat">play</a>
or
<a href="file:///player/play.bat">play</a>
ps.
there's no meanning to your path statement. if you want to change the path from the batch file you should use:
set path=<your path>
or, to add your path in a higher priority than the previous path:
set path=<your path>;%path%
simam3k95
23rd February 2004, 10:24
Dear avih
After numerous experimentation, it boils down to this:
Nothing wrong with the START statement, either slashes work just fine as long as I click the bat file from the win explorer window. But when I access the bat file through the web page, it's a different story. The bat file is executed alright (meaning the link to the bat file is correct) but it throws up the error of not finding the file! To reduce the confusion about the root, I burnt the whole site on a cd. Still, when I click on the bat file from win explorer it works, but from the webpage it doesn't!
Pardon my inability to understand this but it seems like a 'Geenie' changes the statement in bat file whenever it is accessed from the webpage!:confused:
Anyway, thanks again to you all who tried to help.
avih
23rd February 2004, 11:00
try to put there an absolute path. i.e. e:\player\mplayer.exe
the point now is to include the drive letter. as i said it could be that the batch file is started from a different directory.
just give this one a try pls.
simam3k95
23rd February 2004, 22:40
avih
Putting the absolute path works for the player to start. For the movie to open it also requires putting the absolute path but then the switches for the MPC doesn't work. Is there any way to get around this problem?
Thanks.
gircobain
23rd February 2004, 22:47
I recall now that I have had problems with the latest mpc versions when trying to start it out of command line
Try an earlier version, for instance 6.4.6.8
avih
23rd February 2004, 23:11
since i haven't played with MPC's cli, i can't help much but advise you to re-examine the syntax of your switches and of your target file path/description.
forget the html-bat relation for a sec. concentrate on making the batch file independent of your start directory. e.g. put the batch in d:\player\player.bat, and run it from yor c-drive (open a command prompt window, issue a 'c:' command such that you're on the c: drive, and then execute your batch file directly with absolute path).
i think that when this works, your html issue will be solved as well.
pixolex
24th February 2004, 17:31
http://forum.doom9.org/showthread.php?threadid=67258&highlight=autoplay+mpc
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.