|
Post by oldsk3wl on May 13, 2020 1:44:23 GMT 1
I am back to testing and everything still goes well, Jos. TY. If possible I would like to have one version of my programs that runs in both NTVDM and vDos. Currently I launch Word with something like
Run C:\progr~1\micros~2\office\winword.exe "path\filename.doc" This does not work in vdos because C: is not C:
I could USE X: C:\ but then it would not work in NTVDM
I could USE C: C:\ but I think you caution against that. How should I properly launch an application?
Or ... Is there a way to query my environment and tell if I am in Dos or vDos? If so, I could make the code conditional. It would still be one version.
|
|
|
Post by Jos on May 13, 2020 8:08:15 GMT 1
You could use Run CMD /C C:\progr~1\micros~2\office\winword.exe "path\filename.doc" Or test for some environment variable like HOMEDRIVE that isn’t defined in vDos.
Jos
|
|
|
Post by oldsk3wl on May 14, 2020 2:45:59 GMT 1
As you suggested, I queried an environment variable and set a logical so I know whether I am in vDos or NTVDM. Works great. In autoexec.txt I have: USE C: V:\ I use V: to build the path to WINWORD by trial and error.
Once I found Word, it was still not working. This took me a minute.
In the CMD processor I must use C:\progra~1... not V: and it works great. The CMD processor does not know V:. I am learning and I appreciate your support.
You gave me another great idea. Perhaps I can set an environment variable with the path to WINWORD and eliminate having to look for it ever again. This I will try tomorrow. It is late here.
|
|
|
Post by Jos on May 14, 2020 8:59:42 GMT 1
If "path\filename.doc" exists, you could also do CMD /C "path\filename.doc".
Jos
|
|
|
Post by oldsk3wl on May 14, 2020 15:52:50 GMT 1
Yes, the OS will launch the default program. Good suggestion. However, we add a macro to the command line that prints and quits Word. I just tried this and the command processor will launch word but does not honor the macro. I don't think the parameter gets passed.
I created an environment variable WORD and used %%WORD%% to access it. Works great!
run cmd /c %%word%% m:\filename.doc /mMacroName
Much simpler than trial and error looking for the right directory. Migrating to vDos is making me think about things we have been doing inefficiently for 20-25 years. TY, Jos.
|
|
|
Post by Jos on May 14, 2020 16:24:40 GMT 1
If you want to set a Windows variable: The SET command is only valid for the current instance of a command processor. So CMD /C set var=val won’t work for subsequent CMD’s.
Jos
|
|
|
Post by oldsk3wl on May 14, 2020 17:11:11 GMT 1
I set it from the control panel, so it should be persistent.
|
|