leecher1337 / ntvdmx64

Run Microsoft Windows NTVDM (DOS) on 64bit Editions
784 stars 81 forks source link

How to save quick edit mode on restart of ntvdm text pgm #141

Open Chet303 opened 3 years ago

Chet303 commented 3 years ago

There is a reg file you can save quick edit mode using the command prompt. When opening ntvdm.exe text program quick edit mode is deselected by defualt. If selected, does not save on reopen of the app? Any idea how to fix?

G-Rumpel commented 3 years ago

Hi, You could change the state of Quick edit mode (or any other setting) on the fly by wrapping the main program in an other process. Create a batch file to start your main program as follows:

reg add hkcu\console /v quickedit /t reg_dword /d 1 /f
start <path to your main program executable>
reg add hkcu\console /v quickedit /t reg_dword /d 0 /f

The first command will enable quick edit mode. The second one will start your main program in a new process which will inherit this mode. The last command will disable quick edit mode again. You could modify (reverse) these changes depending on your desirable settings. I hope this answers your question.

Chet303 commented 3 years ago

Hi G-Rumpel, Created a .bat file form notepad with your example but for some reason the window flashes open and closes. The location of the executable is on a network share. When I run the script using cmd, flashes the same. With cmd elevated shows error "system cant find the drive specified"

G-Rumpel commented 3 years ago

Hi, It seems that the path is wrong. Please post the actual content of your batch file. You could also modify the start command as follows:

start /wait <path to your main program executable>

This will wait the process to finish before closing the flashing window.

Chet303 commented 3 years ago

adding /wait, still flashes open and closes right away the network share h: is shared and working the only way to open the dos program is with a .pif shortcut copied from 32 bit computer, but it wont save the "quick edit" feature on reopen.

this is the .bat file reg add hkcu\console /v quickedit /t reg_dword /d 0 /f start H:\crs\jobcrs.EXE reg add hkcu\console /v quickedit /t reg_dword /d 1 /f

G-Rumpel commented 3 years ago

What happens if instead of your main program you start a cmd and then try to execute it inside that process?

Chet303 commented 3 years ago

Finally got the dos program on the network share to open, but those reg .bat commands have no effect to enable quickedit on open

G-Rumpel commented 3 years ago

Actually I have missed something small but very important. The start command should be:

start cmd /c <path to your main program executable>

Now the new cmd process and its sub processes will inherit the quick edit mode state set by the first reg command. Sorry for misleading.

Chet303 commented 3 years ago

same result, tried on two 64 bit computers this is the .bat file

reg add hkcu\console /v quickedit /t reg_dword /d 1 /f cd /D H:\CRS start cmd /c JOBCRS.EXE

G-Rumpel commented 3 years ago

I ran out of ideas. I mean these commands work perfectly for me as I change this and other console settings and everything works as expected. On the other hand you should check the settings in the shortcut which starts your cmd process because they might differ from the registry key. Also all my shortcuts start local executables so I could not say if network redirector has anything to do with this behavior.

Chet303 commented 3 years ago

Same here, tried on a new build, same result. Thanks for your help