clam5917 Posted March 20, 2014 Posted March 20, 2014 Hi there, This I my first time posting here. I am also new to AutoIT and scripting as well. I also have search forum for answers but couldn’t find any. I apologize if there was a post similar to mine and I missed it. I took on a new role in my company because someone is leaving the company and only had one week of training with SCCM. I have been learning everything on my own through the wonderful world of Googling and YouTube. Please bear with me as I have been trying to find answer how write this script to update drivers for desktops and laptops in my company and push it through with SCCM. Little summery on what I am trying to accomplish. I am trying to write script that will check few things first. 1. What OSVersion(Win_7, Win_8, Win_Vista) it is, then what OSArch (x64, x86) 2. Then need to verify what GPU it has ($Var1=NVIDIA GeForce, $Var2 = NVIDIA NVS, $Var3 = NVIDIA Quadro) by looking in the $RegRead (HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlVideo) 3. Is this a laptop or desktop 4. Then RunWait (xxxxxxx.exe,) Example: #RequireAdmin @OSVersion = "WIN_7" @OSVersion = "WIN_8" @OSVersion = "WIN_VISTA" @OSArch = "X64" @OSArch = "X86" $Var1 = "NVIDIA GeForce" $Var2 = "NVIDIA NVS" $Var3 = "NVIDIA Quadro" If @OSVersion = "WIN_7" and @OSArch = "X64" then $RegRead = ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video", /$Var2) then RunWait ("332.50_notebookquadro_win8_winvista_win7_64bit_international_whql.exe") EndIf Am I starting in the right direction?
JohnOne Posted March 20, 2014 Posted March 20, 2014 @OSVersion = "WIN_7" @OSVersion = "WIN_8" @OSVersion = "WIN_VISTA" @OSArch = "X64" @OSArch = "X86" You cannot do that. They are internal macro's and cannot be assigned values. However you did correct use of the macro's. If @OSVersion = "WIN_7" and @OSArch = "X64"... so yes, you are on right path. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
clam5917 Posted March 20, 2014 Author Posted March 20, 2014 John, Thanks for your reply. How about having it look in Registry for value and then run .exe? did I type it right? It looks like when go to "Tools" then "Go" I get Error: Unbalanced parenthesis expression and syntax error. >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:UserschrislDesktopTemp_folder_onlyNVIDIA_GeForce_Quadro_Driver_UpgradeGeForce_334.89_Quadro_332.50_Installer.au3" /UserParams +>10:25:49 Starting AutoIt3Wrapper v.2.1.4.4 SciTE v.3.3.7.0 ; Keyboard:00000409 OS:WIN_8/ CPU:X64 OS:X64 Environment(Language:0409 Keyboard:00000409 OS:WIN_8/ CPU:X64 OS:X64) >Running AU3Check (3.3.10.2) from:C:Program Files (x86)AutoIt3 "C:UserschrislDesktopTemp_folder_onlyNVIDIA_GeForce_Quadro_Driver_UpgradeGeForce_334.89_Quadro_332.50_Installer.au3"(16,73) : error: unbalanced paranthesis expression. $RegRead = ("HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlVideo", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:UserschrislDesktopTemp_folder_onlyNVIDIA_GeForce_Quadro_Driver_UpgradeGeForce_334.89_Quadro_332.50_Installer.au3"(16,73) : error: syntax error $RegRead = ("HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlVideo", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:UserschrislDesktopTemp_folder_onlyNVIDIA_GeForce_Quadro_Driver_UpgradeGeForce_334.89_Quadro_332.50_Installer.au3 - 2 error(s), 0 warning(s) !>10:25:49 AU3Check ended. Press F4 to jump to next error.rc:2 +>10:25:49 AutoIt3Wrapper Finished.. >Exit code: 2 Time: 0.916 I know that the pointer is pointing the error is "Video", but just can't figure it out how to fix it.
JohnOne Posted March 20, 2014 Posted March 20, 2014 (edited) looks like a star stray slash. $RegRead = ("HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlVideo", /$Var2) EDIT: typo Edited March 20, 2014 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
clam5917 Posted March 20, 2014 Author Posted March 20, 2014 even if I remove the / I get the same message. If @OSVersion = "WIN_7" and @OSArch = "X64" then $RegRead = ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video", $Var2) then RunWait ("332.50_notebookquadro_win8_winvista_win7_64bit_international_whql.exe") EndIf >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:UserschrislDesktopTemp_folder_onlyNVIDIA_GeForce_Quadro_Driver_UpgradeGeForce_334.89_Quadro_332.50_Installer.au3" /UserParams +>13:12:05 Starting AutoIt3Wrapper v.2.1.4.4 SciTE v.3.3.7.0 ; Keyboard:00000409 OS:WIN_8/ CPU:X64 OS:X64 Environment(Language:0409 Keyboard:00000409 OS:WIN_8/ CPU:X64 OS:X64) >Running AU3Check (3.3.10.2) from:C:Program Files (x86)AutoIt3 "C:UserschrislDesktopTemp_folder_onlyNVIDIA_GeForce_Quadro_Driver_UpgradeGeForce_334.89_Quadro_332.50_Installer.au3"(10,73) : error: unbalanced paranthesis expression. $RegRead = ("HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlVideo", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:UserschrislDesktopTemp_folder_onlyNVIDIA_GeForce_Quadro_Driver_UpgradeGeForce_334.89_Quadro_332.50_Installer.au3"(10,73) : error: syntax error $RegRead = ("HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlVideo", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:UserschrislDesktopTemp_folder_onlyNVIDIA_GeForce_Quadro_Driver_UpgradeGeForce_334.89_Quadro_332.50_Installer.au3 - 2 error(s), 0 warning(s) !>13:12:05 AU3Check ended. Press F4 to jump to next error.rc:2 +>13:12:05 AutoIt3Wrapper Finished.. >Exit code: 2 Time: 0.885
BrewManNH Posted March 20, 2014 Posted March 20, 2014 Are you trying to use RegRead in the second line? Because what you wrote tries to assign the registry key to a variable $RegRead, but you wrote it wrong. Also you have a Then at the end of that line without an If. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
mikell Posted March 20, 2014 Posted March 20, 2014 There are some typos in there If @OSVersion = "WIN_7" and @OSArch = "X64" then $RegRead = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video", $Var2) ; then RunWait ("332.50_notebookquadro_win8_winvista_win7_64bit_international_whql.exe") EndIf
clam5917 Posted March 20, 2014 Author Posted March 20, 2014 BrewManNH, Thanks for your respond. Is there a way to write it so that it will check for variables in the registry path and then execute .exe file after it know the version of OS and OSArch? So, I am new to all this (with very little knowledge) and trying to figure this out for days now.
JohnOne Posted March 20, 2014 Posted March 20, 2014 Please show the full revised code you are trying. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
clam5917 Posted March 20, 2014 Author Posted March 20, 2014 Here is the Code as of right now. #RequireAdmin $Var1 = "NVIDIA GeForce" $Var2 = "NVIDIA NVS" $Var3 = "NVIDIA Quadro" If @OSVersion = "WIN_7" and @OSArch = "X64" then $RegRead = ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video", $Var2) RunWait ("332.50_notebookquadro_win8_winvista_win7_64bit_international_whql.exe") EndIf
iamtheky Posted March 20, 2014 Posted March 20, 2014 (edited) first download and install SciTE http://www.autoitscript.com/cgi-bin/getfile.pl?../autoit3/scite/download/SciTE4AutoIt3.exe Second: open a new .au3, save it, type regread, press F1. Edited March 20, 2014 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
JohnOne Posted March 21, 2014 Posted March 21, 2014 What bothouse said. Also, are you saying RunWait ("332.50_notebookquadro_win8_winvista_win7_64bit_international_whql.exe") does not run? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
clam5917 Posted March 21, 2014 Author Posted March 21, 2014 JohnOne, It keep on error out with "unbalanced Paranthesis expression" and "Syntax error". Please see my attached snap shot.
JohnOne Posted March 21, 2014 Posted March 21, 2014 (edited) See now, that is not what you posted. $RegRead = ("HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlVideo", $Var2) $RegRead = RegRead("HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlVideo", $Var2) Edited March 21, 2014 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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