Jump to content

Get @OSversion of a remote computer


Go to solution Solved by orbs,

Recommended Posts

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?

Link to comment
Share on other sites

@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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Solution

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.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...