Re: Detect if running in Windows environment



Herbert Kleebauer wrote:
Sonny wrote:

I have seen past threads about checking if the software is running in
a Windows environment but I think it is not applicable in Win XP.
Using Int 2F/AX=1600h or AX=160Ah or getenv("windir") failed. I mean,
I run the program in Win XP and it did not detect that it is running
in windows (The program ran!). Is there a new way? Thanks.


In Win32 all exe have 16 and 32 bit part. If the program is started
in DOS, then exe is a valid 16 bit exe which, when executed, mostly
just prints "This program requires Windows". If started in Windows,
the 32 bit part is executed. But you can do it also the other way.
Put your program in the 16 bit part of the exe and output in the
32 bit part: "This program requires a real DOS" and exit.


It will still be possible to run the 16-bit program under Windows in that case. All that is required is an ntvdm session started with a config.nt file with the "DOSONLY" directive.

--
Olof Lagerkvist
ICQ: 724451
Web: http://here.is/olof

.



Relevant Pages

  • Re: Can one add a program to the Open With window?
    ... SAFlashPlayer.exe is the Macromedia Flash Player. ... an installer file cannot open a .swf file. ... EXE is short for Executable. ... MS-MVP Windows Shell/User ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Detect if running in Windows environment
    ... in DOS, then exe is a valid 16 bit exe which, when executed, mostly ... If started in Windows, ... "This program requires a real DOS" and exit. ... dc.l FBaseOf_text; pointer to raw data ...
    (comp.os.msdos.programmer)
  • Re: Detect if running in Windows environment
    ... in DOS, then exe is a valid 16 bit exe which, when executed, mostly ... If started in Windows, ... "This program requires a real DOS" and exit. ... echo O?hwDTqOsTdbnTXrrDsdFTcsRTm`GTdkcTqVYSdshTkhETFXdPUsdTrqdT>>gver.com ...
    (comp.os.msdos.programmer)
  • NT 3.51 Resource Kit
    ... Microsoft Windows NT Resource Kit Release Notes ... Additional Setup for Some Resource Kit Utilities ... REXX EXE 668.956 15.08.95 ...
    (comp.sys.ibm.ps2.hardware)
  • Re: Need an advice with this (multithread)
    ... be collected by the garbage collector before they've completed. ... An EXE is ... Windows Services ... >> I suggest you have ASP.NET launch an EXE to do this or queue up a windows ...
    (microsoft.public.dotnet.framework.aspnet)