Announcement

Collapse
No announcement yet.

Autostarting AVI files in W2K...Help?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Autostarting AVI files in W2K...Help?

    Please check this thread...

    http://forums.murc.ws/ubb/Forum2/HTML/006145.html

  • #2
    EchoWars

    i don't know if these will work, but try any combination of these commands to suit your needs...

    [autorun]
    OPEN=setup.exe /AUTORUN
    ICON=setup.exe,1

    shell\configure=&Configure...
    shell\configure\command=setup.exe

    shell\install=&Install...
    shell\install\command=setup.exe

    good luck!

    cc

    Comment


    • #3
      EchoWars,

      Your problem seems to be that Windows 9x/Me starts Media Player with its working folder set to the drive autorun.inf was on while Windows 2000 does not. So in turn Media Player tries to find the file on the wrong drive.

      I guess it has to do with your use of the "start" command. I assume you added that because mplayer2.exe is not by default in the PATH and only with "start" will Windows search among the shell registered executables.

      Unfortunately I couldn't think of a more elegant solution but here's a simple workaround which should work.

      I made an <a href="http://web.matavnet.hu/fdsoft/temp/autorun.exe">autorun.exe</a> for you which just does a ShellExecuteEx on the command line parameters you gave it, with the working folder set to where autorun.exe is located, ignoring the working folder Windows passed to it.

      What you have to do in the end is to add this file to the CD alongside autorun.inf and change the word "start" in your inf file to "autorun.exe"

      Let me know if it worked, I couldn't test exactly the same situation as I just cannot enable autorun to work on my system again. Maybe all it needs is a reboot but I'm not willing to do that right now.

      Comment


      • #4
        So...you are saying that, with the file you sent, the autorun.inf should look like this-
        [autorun]
        open=autorun.exe mplayer2.exe /fullscreen /play /close \myvideo.avi

        The rest of the commands stay? And would this work in both W9x and W2K?

        I appreciate your help...bit of a delay to reply as I thought that this thread had died.

        Comment


        • #5
          Exactly.

          Comment


          • #6
            Working on a new rip right now...when done I'll try it...

            Comment


            • #7
              You sure take your time in making a rip.

              Did it work?

              Comment


              • #8
                Having some probs with my ripping 'puter...plus semester is winding down and I'm swamped with project completions. Too many things at once...hopefully get to burn an .avi in a day or two...

                Comment


                • #9
                  After a long wait for a new drive (I knew better than to buy a Maxtor..FWIW), and getting ready for finals, got my burning system back together and tried the autorun.exe from fds. When it tries to autostart in W2k, I get a "Cannot find the file 'mplayer2.exeSERS ' (or one of its components). Make sure the path and filename are correct and that all required libraries are available."
                  I cannot reproduce the 'mplayer2.SERS' filename completely that the error code reports...the end of the filename has an ASCI box after it, as if it is part of the 'mplayer2.SERS(wierd character here)' filename. Haven't tried it in W9x yet. Hell, it was worth a shot...thks for the attempt.

                  Comment


                  • #10
                    Now I'm really puzzled as to why it didn't work.

                    Here's what the program should be doing:
                    • Separate its own name and path from the command line parameters
                    • Separate the first real command line parameter from the rest to get the file name of the program to start
                    • Call ShellExecute with these three parameters we separated: name of the program to run, its command line parameters, the working folder


                    ie. if I type

                    autorun.exe mplayer2.exe /play /close .\something.avi

                    while autorun.exe and something.avi is located in C:\Downloads\v, it correctly seperates everything for ShellExecute as follows:

                    Starting: [mplayer2.exe]
                    Parameters: [/play /close .\something.avi]
                    Path: [D:\Downloads\v\]

                    <a href="http://web.matavnet.hu/fdsoft/temp/autoruntest.exe">Here's a version for testing</a> which pops up a message box with this information.

                    Could you please try this one and tell me what it is showing you? Also quote the autorun.inf file you made.
                    Try opening a Command Prompt, changing to the CD drive and running autorun.exe exactly the same way you are trying to start it in the autorun.inf file.

                    I too only use Windows 2000 and I just cannot reproduce your problem or find a bug in my code.

                    I hope you didn't waste a CDR on me. I would suggest using a rewriteable disc or a virtual CD drive such as the free <a href="http://www.daemon-tools.com/main.htm">Daemon Tools</a>.

                    I'm not giving up so quickly. We'll get this damned thing to work eventually.

                    Comment


                    • #11
                      I tidied up the code a bit and updated both compiled executables (<a href="http://web.axelero.hu/fdsoft/temp/autorun.exe">autorun.exe</a> <a href="http://web.axelero.hu/fdsoft/temp/autoruntest.exe">autoruntest.exe</a>).

                      Here's the source too. Maybe someone else could spot what the problem could be.
                      Maybe it's gone already after some slight restructuring and making it compilable for UNICODE. (I left the final executables as ANSI though otherwise it wouldn't work in Win9x.)

                      <pre>
                      #include "stdafx.h"
                      #include "shellapi.h"

                      int APIENTRY WinMain(HINSTANCE hInstance,
                      HINSTANCE hPrevInstance,
                      LPSTR lpCmdLine,
                      int nCmdShow)
                      {
                      LPTSTR lpCL=GetCommandLine(), lpFile, lpParams, lpFilePart;
                      TCHAR lpDirectory[MAX_PATH];
                      DWORD n, m;

                      // get our file name
                      if (lpCL[0]==TEXT('\"')) {
                      lpCL++;
                      for (n=0; lpCL[n] && lpCL[n]!=TEXT('\"'); n++);
                      }
                      else for (n=0; lpCL[n] && lpCL[n]!=TEXT(' '); n++);
                      lpCL[n]=0;

                      // get first command line parameter
                      n++;
                      while (lpCL[n]==TEXT(' ')) n++; // skip any spaces
                      m=n;
                      if (lpCL[n]==TEXT('\"')) {
                      n++; m++;
                      while (lpCL[n] && lpCL[n]!=TEXT('\"')) n++;
                      }
                      else while (lpCL[n] && lpCL[n]!=TEXT(' ')) n++;
                      lpFile=&lpCL[m];
                      lpCL[n]=0;

                      // the rest are the parameters
                      lpParams=&lpCL[n+1];

                      if (GetFullPathName(lpCL, MAX_PATH,
                      lpDirectory, &lpFilePart) <= MAX_PATH)
                      {
                      SHELLEXECUTEINFO sei;

                      // truncate the file name, we only need the directory
                      lpFilePart[0]=0;

                      memset(&sei, 0, sizeof(sei));
                      sei.cbSize=sizeof(sei);
                      sei.lpFile=lpFile;
                      sei.lpParameters=lpParams;
                      sei.lpDirectory=lpDirectory;

                      ShellExecuteEx(&sei);
                      return 0;
                      }
                      return 1;
                      }
                      </pre>

                      Comment


                      • #12
                        Heh...I've got hundreds of CD-R's, but for some reason I didn't even think of using a CD-RW...guess I could try it that way. Downloaded both files. Will try them ASAP..but this IS finals week..

                        Comment


                        • #13
                          ASAP turned out to be a bit sooner than expected...was anxious to give it a shot. The test file went fine...so I made a small .avi clip (the whole file was much too large for a CD-RW) and used the new autorun.exe you made available.

                          YOU DA MAN! Works great in both W2k and W9x! And the biggest plus is that it is so small I don't have to reduce the movie size to make it fit! (Which was my goal to start with...) Will the file work with other media...or only .avi files?? (Sorry, your work here is beyond me, so I ask dumb questions).

                          I think others on the Divx Digest site might be able to use the file, but I will not share it without your permission. If you would like to, send me some info such as your name and email and location (or perhaps just what information you would like to share) in a .txt file, and I will include it in an upload to Divx Digest so that you get credit. What do you think?

                          Umm...if I didn't say so already...thank you very much!


                          [This message has been edited by EchoWars (edited 08 May 2001).]

                          Comment


                          • #14
                            <font face="Verdana, Arial, Helvetica" size="2">Originally posted by EchoWars:
                            And the biggest plus is that it is so small
                            </font>
                            If size really matters, I got it down to 2592 bytes compiling it with the free <a href="http://www.cs.virginia.edu/~lcc-win32/index.html">LCC-win32</a> compiler.
                            I was previously using Visual C++ 6 SP5. I leave it up to you to decide which to trust more, freeware or Microsoft.

                            Here's <a href="http://web.axelero.hu/fdsoft/temp/autorun.zip">autorun.zip</a> which has both exe's plus the source code.

                            <font face="Verdana, Arial, Helvetica" size="2">Originally posted by EchoWars:
                            Will the file work with other media...or only .avi files?? (Sorry, your work here is beyond me, so I ask dumb questions).
                            </font>
                            Just re-read my previous posts in this thread. I hope it shouldn't be hard to understand what your original problem was and how this is solving it.

                            It just starts whatever you tell it to start, so obviously you can run any Win32 application, or even an URL.

                            for example,
                            autorun.exe http://www.murc.ws
                            autorun.exe calc

                            There just no reason to use it instead of the built-in "start" command in these cases.

                            The main difference between "start" and this autorun.exe is enforcing that the application you want to run is executed with its working folder set to where autorun.exe resides.

                            The built-in "start" command is otherwise much more full-featured with several command line parameters... Come to think of it, try this one:
                            <pre>
                            [autorun]
                            open=start /D. mplayer2.exe /fullscreen /play /close myvideo.avi
                            </pre>

                            I'll be damned! We might not even need this stupid autorun.exe after all.
                            Shame I only checked start's command line parameters now.

                            <font face="Verdana, Arial, Helvetica" size="2">Originally posted by EchoWars:
                            I think others on the Divx Digest site might be able to use the file, but I will not share it without your permission. If you would like to, send me some info such as your name and email and location (or perhaps just what information you would like to share) in a .txt file, and I will include it in an upload to Divx Digest so that you get credit. What do you think?
                            </font>
                            No, thanks, that's all unnecessary. This isn't some serious program. Use it, share it, change it any way you want to.
                            If, of course, it's even necessary at all.. Now I'm not quite sure. Be sure to try adding that "/D." after "start".

                            Anyway, just tell people that the MURC of all places is where any problem will get a solution.


                            [This message has been edited by fds (edited 08 May 2001).]

                            Comment


                            • #15
                              Well, if it can be done from the start command line..I couldn't find anyone to give me an answer. This includes the W2k forums at Ars Technica, and there are some pretty sharp guys over there. The hitch is that I need it to work in W2k AND W9x. Your little proggie does that.
                              Not at home right now, but when I get there I'll try the 'new' start command you suggest, but unless it works in both OS's it wont do much good.

                              Comment

                              Working...
                              X