|
Post by borgus on Jan 15, 2019 1:28:26 GMT 1
What is the DOS syntax for invoking a box that asks which file to load?
Specifically, the file structure is C:\vDOS (containing that program's files) with a subfolder titled SYDEX that sports their emulator files PLUS the Perfect Calc executable and a few spreadsheets. The object is to write the syntax into Autoexec so a click on vDOS.exe fires up Perfect Calc and prompts for the file name.
Many thanks
|
|
|
Post by Jos on Jan 15, 2019 2:22:39 GMT 1
Don’t know of a DOS command displaying a box and asking for a filename (to load?).
If you want to start Perfect Calc prompting for the file to load, w/o entering a command like “/fl”, you have to consult the Perfect Calc documentation. Better yet, switch to one of the many Windows spreadsheet programs.
Jos
|
|
Joe Caverly
Guest
|
Post by Joe Caverly on Jan 21, 2019 15:31:38 GMT 1
Here is the method that I use to prompt for a file before I launch vDos.
Note that my system is Windows 7 64-bit, vDos 2016.10.01
First, create a file called FileOpen.vbs, with the following contents;
Set wShell=CreateObject("WScript.Shell") Set oExec=wShell.Exec("mshta.exe ""about:<input type=file id=FILE><script>FILE.click();new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);close();resizeTo(0,0);</script>""") sFileSelected = oExec.StdOut.ReadLine wscript.echo sFileSelected
Next, from the cmd.exe prompt, I change to the directory that contains the program that I want to run in vDos;
cd c:\vDos\wpo
I then run the following command;
for /f %i in ('cscript //nologo c:\utils\fileopen.vbs') do ..\vdos.exe %~nxi
This runs the fileopen.vbs script, which prompts for a file.
In my case, I am selecting C:\Users\jlc\utils\astronmy.txt
Note that I have the C:\Users\jlc\utils directory on my Windows system mapped as drive U: in vDos
After a file is selected, vDos is launched, starting WordPerfect Office, in my case.
From the vDos prompt, echo %WIN_VDOS%, which should display the file that you selected using the FileOpen dialog.
You can now run your program from vDos, using the file that you selected using the FileOpen dialog, in my case;
ed U:%WIN_VDOS%
Joe
|
|
|
Post by emendelson on Jan 21, 2019 19:44:48 GMT 1
Here's a compiled AutoIt script that can be put in the same directory with vDos.exe. It opens a dialog in which you select a file and then it does two things: 1. It launches vDos with the short filename of the file as parameter so you can use with the WIN_VDOS environment variable in vDos. 2. It sets the Windows variable WIN_FULL to the short filename of the full path of the file so that you can use it in vDos with this command: set win_full=%%win_full%%
(or, of course, set any_variable_name=%%win_full%%)
3. If you create a shortcut to vDosSend.exe and use a directory name as a parameter for vDosSend.exe in the shortcut (or if you launch vDosSend.exe with a directory name as a parameter), the select-file dialog will open in the directory you specify. If you don't add a parameter, the dialog opens in the same directory with the program itself. This has minimal error checking, but it seems to get the job done. A real programmer could write it in 20KB; compiled AutoIt is a lot bigger. Download:
Edit: I've included the AutoIt script in the zip file.
|
|
|
Post by borgus on Jan 22, 2019 9:37:21 GMT 1
Appreciate all for taking the time to outline their methodology.
|
|