grunewald6 Posted August 23, 2013 Share Posted August 23, 2013 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 More sharing options...
water Posted August 23, 2013 Share Posted August 23, 2013 @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 - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Solution orbs Posted August 23, 2013 Solution Share Posted August 23, 2013 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 More sharing options...
grunewald6 Posted August 23, 2013 Author Share Posted August 23, 2013 RegRead with that key does it. Thanks for the quick reply! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now