Sign in to follow this  
Followers 0
PearsonAus

AutoIt Script quit if it is detected on a 'Server' Version of Windows

11 posts in this topic

#1 ·  Posted (edited)

Hi All

We need a line to make the script quit if it is detected on a 'server 2003' version of windows.

Can someone help me with this?

Thanks Heaps

PearsonAus

Edited by PearsonAus

Share this post


Link to post
Share on other sites



Define "server". Are you referring to Windows NT Server, Windows Server 2003, and Windows Server 2008?

Share this post


Link to post
Share on other sites

It is Windows Server 2003 version. And thanks for pointing this out.

Define "server". Are you referring to Windows NT Server, Windows Server 2003, and Windows Server 2008?

Share this post


Link to post
Share on other sites

maybe this helps:

@OSVersion

try what it say running on your 2003 server:

msgbox (64, "", @OSVersion)

then you could use it like

if @OSVersion = "WIN_2003" then ...

or maybe a combination of macros helps you

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Then add a line at the top of the script.

If @OSVersion = "WIN_2003" Then Exit
Edited by Richard Robertson

Share this post


Link to post
Share on other sites

Hi Richard

Thanks alot for the quick help. I was just wondering as I am not a developer so it is possible if you can help me how to create the whole code from the scratch.I'll add this into our existing script file anyway for testing.

Regards

PearsonAus

Then add a line at the top of the script.

If @OSVersion = "WIN_2003" Then Exit

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Hi Richard

Thanks alot for the quick help. I was just wondering as I am not a developer so it is possible if you can help me how to create the whole code from the scratch.I'll add this into our existing script file anyway for testing.

Regards

PearsonAus

The whole code for what? That is the whole code to terminate the script if the version of windows returns as WIN_2003.

I don't think @OSVersion differentiates between, say, WIN NT4 Workstation & Server, though (unless you also use @OSBuild but even then I suspect the same SP level is the same build).

You could use @LogonDomain and check if it equals @ComputerName but that assumes that any server a) is configured to use a domain, :D computer name doesn't = domain name. I would expect these to be true in pretty much every case, but its a workaround way to do it.

Edited by Khab

Share this post


Link to post
Share on other sites

AutoIt has dropped support for Windows 2000/NT. It's not worth worrying about it.

Share this post


Link to post
Share on other sites

Richard

Thanks for the detailed information and help.

However, when I run the code which you gave me earlier last week - it detects "Windows Server 2003" as "Windows XP version" even if I ran this on XP or Server. So tried playing arround and found something new for me here:

If @OSBuild = "3790" Then Exit

EndIf

The above script works fine.

Anyway I am not sure why it was not detecting OSVersion type where it is detecting OSBuild. Any idea?

Regards

PearsonAus

Share this post


Link to post
Share on other sites

Well, Windows Server 2003 is built on XP. Perhaps it's a bug in the version of AutoIt you are using. Are you using the latest beta?

Share this post


Link to post
Share on other sites

AutoIt has dropped support for Windows 2000/NT. It's not worth worrying about it.

Uhmm... I think all the Win32 APIs of WinNT and Win2K are still supported.

What was dropped a while ago was support for Win16 APIs (Win 3.1, Win9x).

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0