pablo472 Posted February 26, 2013 Share Posted February 26, 2013 Hi, I'm completely new to scripting and AutoIT was recommended to me.I’m trying to copy a Logon.vbs script to the Logon scripts folder in Win 7 x64 and add a registry key using AutoIT.When compiled, the adding of the Reg key works fine but the copying/installing of the reg file to the ScriptsLogon folder will not play ball.So far, I’ve tried the following two scripts but to no avail. Any ideas?;Automate copying of .VBS file from local folder to Logon script folder;Then add a Registry DWORD with a value of 1 to enable Logon Scripts to be run#RequireAdminFileInstall(".Logon.vbs", "C:\Windows\System32\GroupPolicyUserScriptsLogon")RegWrite ("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem", "EnableLinkedConnections", "REG_DWORD", "00000001")-------------------------------------------------------;Automate copying of .VBS file from local folder to Logon script folder;Then add a Registry DWORD with a value of 1 to enable Logon Scripts to be run#RequireAdminRegWrite ("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem", "EnableLinkedConnections", "REG_DWORD", "00000001")Local $b = TrueLocal $dest = TrueIf $b = True & $dest = True Then FileInstall ("C:UsersPaulDesktopScriptingToolsNew folderLogon.vbs", $dest = @WindowsDir & "System32GroupPolicyUserScriptsLogon")Regards Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 26, 2013 Moderators Share Posted February 26, 2013 pablo472, Welcome to the AutoIt forum. Please do not hijack an existing thread, just start a new one - especially when there was not a lot to link your question to it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
pablo472 Posted February 27, 2013 Author Share Posted February 27, 2013 Anybody? Link to comment Share on other sites More sharing options...
water Posted February 27, 2013 Share Posted February 27, 2013 Please wait at least 24 hours before you bump a thread. 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...
water Posted February 27, 2013 Share Posted February 27, 2013 LineIf $b = True & $dest = True Then FileInstall ("C:\Users\Paul\Desktop\ScriptingTools\New folder\Logon.vbs", $dest = @WindowsDir & "\System32\GroupPolicy\User\Scripts\Logon\")should read: If $b = True And $dest = True Then FileInstall ("C:\Users\Paul\Desktop\ScriptingTools\New folder\Logon.vbs", @WindowsDir & "\System32\GroupPolicy\User\Scripts\Logon\") 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...
pablo472 Posted February 27, 2013 Author Share Posted February 27, 2013 My apologies Water. Just a newbie pulling my hair out. Won't happen again and thank you very much. I will give it a try. Kind Regards Link to comment Share on other sites More sharing options...
water Posted February 27, 2013 Share Posted February 27, 2013 The "&" you used is a concatenation operator, not a logical operator. When setting parameters you never pass the name of the parameter ($dest) but just the value. 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...
pablo472 Posted February 27, 2013 Author Share Posted February 27, 2013 (edited) Hmmm, still no luck. Not quite sure what I'm doing wrong: #RequireAdmin RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLinkedConnections", "REG_DWORD", "00000001") Local $b = True Local $dest = True If $b = True And $dest = True Then FileInstall ("C:\Users\Paul\Desktop\Scripting\Newfolder\Logon.vbs", @WindowsDir & "\System32\GroupPolicy\User\Scripts\Logon\") Even renamed and removed the space between New Folder\ Edited February 27, 2013 by pablo472 Link to comment Share on other sites More sharing options...
water Posted February 27, 2013 Share Posted February 27, 2013 Can you manually copy the file to @WindowsDir & "System32GroupPolicyUserScriptsLogon"? 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...
pablo472 Posted February 27, 2013 Author Share Posted February 27, 2013 Oddly enough yes and although we have been doing this manually, I was determined to automate it. Will have another go tomorrow. Link to comment Share on other sites More sharing options...
pablo472 Posted March 1, 2013 Author Share Posted March 1, 2013 Ok, I finally got it to work with this: #RequireAdmin RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLinkedConnections", "REG_DWORD", "00000001") DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1) Local $b = True Local $dest = True If $b = True And $dest = True Then FileInstall ('C:\Users\Paul\Desktop\Scripting\Newfolder\Logon.vbs', @WindowsDir & '\System32\GroupPolicy\User\Scripts\Logon\') DllCall("kernel32.dll", "int", "Wow64EnableWow64FsRedirection", "int", 1) Only trouble is, it doesn't actually select/enable the script as it would if you did it manually within GPedit, therefore although the script itself does as it's asked, it doesn't finish the job so to speak. Any ideas if it's possible to get it to select/enable the script as you would manually? Regards Link to comment Share on other sites More sharing options...
pablo472 Posted March 4, 2013 Author Share Posted March 4, 2013 Any ideas? Link to comment Share on other sites More sharing options...
pablo472 Posted March 13, 2014 Author Share Posted March 13, 2014 12 months on and still no luck! LOL I gave up and did it all manually in the end using a .reg and .vbs scripts. Would have been nice to automate the whole thing though. 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