Menu

vDOS Commandline switches or options

General
Anonymous
2014-11-04
2014-11-04
  • Anonymous

    Anonymous - 2014-11-04

    Hi, I have just found this program, and quite keen on testing it, to see if it will do what I need.

    I have a DOS program that I run with commandline options on the end, eg to simplify, it is like this:
    abc.exe C:\test.txt
    in 16 and 32bit OS, this opens abc.exe, and loads the text file C:\test.txt in.
    How would I provide a command line in vDOS, when the commandline option always changes.

    So in my autoexec.txt I have the line
    abc.exe C:\test.txt
    and this works. But the commandline option or filename in this case is always different. It needs something like what works in bat files, like
    abc.exe %1

    Is this possible please ?
    Thanks,
    Grant

     
    • Jos Schaars

      Jos Schaars - 2014-11-04

      You want to start a DOS program in vDos with a variable that’s set outside of vDos?
      Set some Windows environment variable: %filename%=c:\test.txt.
      Then in autoexec.txt:
      abc.exe %filename%

      Jos

       
      • Anonymous

        Anonymous - 2014-11-04

        Thanks Jos, that works. Just to help others, with your help, I expanded on that, and here is what I did.
        Contents of abc.bat
        SET filename=%1
        C:\vDos\vDos.exe
        exit
        And in autoexec.txt
        abc.exe %filename%

        Then to run with a filename, from command prompt type the following:
        C:\path\abc.bat c:\test.txt

        This runs abc.bat passing the filename as first parameter. In bat file it shows as %1, and this is set to the environment variable, in this case the filename. Then from in autoexec.txt the environment variable holds the filename set from the bat file, and so launches abc.exe c:\test.txt

         
        • Jos Schaars

          Jos Schaars - 2014-11-04

          To add to this:
          If a DOS variable isn’t found, the Windows environment is searched by vDos.
          So %filename% can be found by vDos’s shell, not being a DOS environment variable!
          To make this available to DOS programs, you would have to SET filename=%filename% in autoexec.txt.
          Until now, I’m reluctant to add %1, %2… to starting vDos, it’s confusing at least.

          Jos

           
  • Anonymous

    Anonymous - 2014-11-04

    Thanks so much for this program. It works well, and I have made a donation today.

     
MongoDB Logo MongoDB