|
Post by harrya on Apr 13, 2022 2:31:04 GMT 1
My understanding is that if I execute the RUN command but include CMD, I will be using the Windows CMD.exe. However, Foxpro won't accept RUN CMD and gives me an error. I would like to call the batch file from Foxpro, then run the batch file under Windows, and then return to Vdos which is running my PRG or EXE Foxpro program. Can I do this?
|
|
|
Post by Jos on Apr 13, 2022 4:24:05 GMT 1
What vDos version do you use and what error is reported by FoxPro?
RUN CMD should work just fine, though you’ll have to add /C to let it execute something.
For testing eventually use the /K switch instead to keep the CMD windows open/visible, for instance RUN CMD /K DIR.
Jos
|
|
|
Post by harrya on Apr 13, 2022 16:06:03 GMT 1
Jos, I was able to get the batch file to work using your suggestions, however, some of the batch file commands aren't being processed correctly and also I get a message "sharing violation". Do I understand that the batch file is being processed by the Windows command prompt, not the Vdos command prompt? I know the batch file works correctly using NTVDM with 32 bit Windows 10. I am using version 2021.05.01
|
|
|
Post by Jos on Apr 13, 2022 16:23:38 GMT 1
RUN CMD in vDos/FoxPro or plain RUN in NTVDM result in the Windows command processor (CMD) executing the command(s).
Jos
|
|
|
Post by harrya on Apr 13, 2022 20:50:26 GMT 1
Jos, Would there be a reason to upgrade to Vdos plus?
|
|
|
Post by Jos on Apr 13, 2022 22:08:02 GMT 1
Upgrade?
vDosPlus is vDos 2015 plus some additions. If I would consider any useful, that would of course already be in vDos.
But if you find a vDosPlus addition an improvement to vDos, then use that.
Jos
|
|
|
Post by harrya on Apr 19, 2022 6:29:47 GMT 1
Jos: My batch files are working using RUN Cmd /c as you suggested. However, when I run "Run Cmd dir /o:e /p &m_name" from Foxpro, it doesn't work. I get nothing. If I run the same command from the cmd.exe prompt, "dir /o:e /p 00glcons.db?" it works fine and lists 9 files which is correct. If I put the command "dir /o:e /p %1" in temp.bat, and then call temp.bat from Foxpro, "run cmd /c temp.bat m_name", the directory listing works. Why won't the first approach work, when I run "run cmd /c dir /o:e /p &m_name" from Foxpro, since I understand that running "run cmd /c" uses Windows Cmd.exe? And running the command from the cmd.exe prompt in Windows gives me the correct directory listing of 9 files.
|
|
|
Post by Jos on Apr 19, 2022 6:54:44 GMT 1
You mention and seemingly used "Run Cmd dir /o:e /p &m_name". That has no /c or /k switch, so CMD does nothing.
Jos
|
|
|
Post by harrya on Apr 19, 2022 17:19:37 GMT 1
Sorry, I always used "run cmd /c dir /o:e /p &m_name' I tried additional variations. "run cmd /c dir" works But "run cmd /c dir 00GL*.DBF", "run cmd /c dir 00glcons.dbf" , "run cmd /c "dir 00glcons.dbf"" do not work (without quotes) . Nothing comes up. If I use these commands from the command prompt or run the program using Windows 10 NTVDM everything works fine.
|
|
|
Post by Jos on Apr 19, 2022 17:51:43 GMT 1
The issue would be:
CMD /C <command> lets CMD execute <command>. The output is displayed in CMD’s own window that closes after <command> is executed. If you instead do CMD /K <command>, the CMD window isn’t closed.
NTVDM is started by and runs in a CMD window. That window is then used to display the output. CMD and NTVDM share the same window.
<command> at the vDos command prompt, is executed by the vDos command processor. Not CMD, so the output goes to the vDos window.
Jos
|
|
|
Post by harrya on Apr 19, 2022 18:24:44 GMT 1
Thank you. The /K worked.
|
|