Jump to content
Sign in to follow this  
grunewald6

Get @OSversion of a remote computer

Recommended Posts

grunewald6

Is there a way to use the @OSVersion macro to get the windows version of a remote computer?  I have a script that runs and copies files or folders to either the all users desktop or all users startup folder, and we have an XP/Win7 mixed environment so the paths to those two directories are different. 

I'd like to make an If..Then statement to handle the 2 different paths but can't figure out an easy way to determine if the host I'm copying to is win7 or XP.  Any ideas?

Share this post


Link to post
Share on other sites
water

@OSVersion returns the version of the computer where the script is being executed.

To get the OS version of another computer you need to use WMI or something similar.

Have a look at Scriptomatic in the Example Scripts forum. This will generate the WMI code for you.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
orbs

all the info you need is in:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion

anyway, you must have sufficient privileges on the remote machine to execute RegRead() or WMI calls.

Share this post


Link to post
Share on other sites
grunewald6

RegRead with that key does it.  Thanks for the quick reply!

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  

×