Determine version of Windows
Determine version of Windows
(OP)
I need to determine the version of windows that my compiled QB4.5 program is running under. In my program, I am shelling out to run a batch file that is created from within the program. In order to run the programs properly from the batch file, I need to specify either the use of COMMAND for Win9x or CMD for WinXP. For this reason, I need to determine the version of windows so that I can shell properly. Any suggestions?
RE: Determine version of Windows
find the OS.
for Qbasic try
shell "ver"
or shell "ver >my.fil"
then,
open "my.fil" for input as #1
while not eof(1)
line input #1,LL$
if LL$<>"" then OS$=LL$
wend
close
RE: Determine version of Windows
RE: Determine version of Windows
Perhaps, If you have a little win program, maybe it will
return an error if running in booted dos mode
RE: Determine version of Windows
%, 2004
RE: Determine version of Windows
CODE
CLS
SHELL "ver > Temp.fil"
OPEN "temp.fil" FOR INPUT AS 11
WHILE NOT EOF(11)
LINE INPUT #11, Aline$
IF Aline$ <> "" THEN OS$ = Aline$
WEND
CLOSE #11
KILL "temp.fil"
'--Get global variable. (Per MiggyD)
WinOpen$ = ENVIRON$("windir")
WinOn$ = "Windows Running?: "
IF LEN(WinOpen$) > 1 THEN
WinOn$ = WinOn$ + "Yes, most likely"
ELSE
WinOn$ = WinOn$ + "Most likely DOS"
END IF
'--Display Info
PRINT
PRINT "Operating System: "; OS$
PRINT WinOn$
PRINT
'--Write down info
OPEN "Answers.txt" FOR APPEND AS 14
PRINT #14, "Operating System: "; OS$
PRINT #14, WinOn$
PRINT #14,
CLOSE #14
Following is from the "Answers.txt" it generated:
Testing Info:
I'm currently on Win ME (which doesn't allow: Start in DOS mode).
I have both a '95 and a '98 Boot disk. Started system from floppies (which generated the first two results--sorry, I don't plan on finding a spare drive and re-installing either of these, you'll have to test this out on your own.)
This code was NOT tested on an NT or XP system. Results obtained may vary or be inconclusive {see below}.
--end test info--
I Hope This Helps you. Be cautious! In XP there's the capability to "do not let program detect running under windows" (or something to that effect.)
Again, HTH.
--MiggyD
RE: Determine version of Windows
Windows ME does allow booting to dos you have to use the magic button F8
%, 2004
RE: Determine version of Windows
I used your "magic" button and this is what I got:
At the bottom it said:
I'm pretty certain I would not have stated that without first checking my system. Maybe there's a different build of ME (or an "Upgrade to ME") that you used. Don't know, don't matter. As I said before, "you'll have to test this out on your own." I was only giving you the results per the current machine I was on.
Good luck,
--MiggyD
RE: Determine version of Windows
XP allows Dos boot... BUT... it loads windows first...
(so what's the point... right?)
You have to log on to go to the Dos Mode...
If you are still using WinME... WHAT IS WRONG WITH YOU ???
J/K
Good Luck,
Josh
[b][color blue]Have Fun, Be Young... Code BASIC

-Josh
http://cubee.topcities.com
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
RE: Determine version of Windows
The best way to use dos is to use a boot floppy disk. Find an old computer, running Win 3.1, go to the File Manager and tell it to make a boot disk.
RE: Determine version of Windows
sysinternal.com make a program called NTFSDos
which they have two version
1). Is Free but it will only let you have read-only access to your harddrive.
2). You have to pay for and you get full access.
%, 2004
RE: Determine version of Windows
I just had an occurance to do that with a computer plagued
by worms and such.
BTW, I have a client running XP at his office and it seems to get viruses (like maybe 5 per day) whereas the W98 I have here doesnt with the same antivirus and same firewall.
Any ideas anyone ?
RE: Determine version of Windows
login as the admin
disable system restore
go to the c drive go to the propertys of this folder "System Volume Information"
go to the security tab
give all the users on the system full permission for this folder(go to advanced check the box starting with Replace~1) click ok, click ok
^this is a location on xp that viruses like to hide since by default windows does not give any user on the system access to this dir(so when you do a virus scan the program can not search here because none of the users have permissions to access this directory).
go to this location C:\Documents and Settings
go to these locations and delete the contents of each folder
C:\Documents and Settings\username\Cookies
C:\Documents and Settings\username\Local Settings\Temp
C:\Documents and Settings\username\Local Settings\Temporary Internet Files
C:\WINDOWS\Temp
These are alot of locations that viruses hide
also this person might have p2p software which is where the main way viruses are spread.
Also make sure that windows has all of the lastest patches
%, 2004
RE: Determine version of Windows
after you do this reboot to safemode with networking then try going here
http://housecall.trendmicro.com
click "Scan Now. It's Free!"
check auto fix then have it scan the harddrive
then you should be done although you may want to also use software that is specificly for adware/spyware a very good one is ad-aware(made by Lavasoft) they have a free version
%, 2004