cpremo Posted August 27, 2007 Share Posted August 27, 2007 (edited) I'm really new to AutoIT and need some help. Our HelpDesk manager want to push a change to all PCs without having to manually touch them. If possible we would like to do this: 1. Determine the logged in users "C:\Documents and Settings" user folder string (i.e., C:Documents and Settings\UserName\My Documents). 2. After creating a new folder at root (C:\PCUpdates), give all users full rights to the folder. We would then use this folder to "Push" any changes we want to make to the PC using AutoIT. So basically, I'm asking a favor for assistance in writing the code to accomplish this task. Thanks. Edited August 27, 2007 by cpremo Link to comment Share on other sites More sharing options...
Fossil Rock Posted August 27, 2007 Share Posted August 27, 2007 @MyDocumentsDir Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
weaponx Posted August 27, 2007 Share Posted August 27, 2007 You need to elaborate on your usage of the term "push". Are you intending to launch a program remotely? - or - Are you wanting to copy a file into C:\PCupdates which the user will be able to run? Link to comment Share on other sites More sharing options...
cpremo Posted August 27, 2007 Author Share Posted August 27, 2007 First, I'm trying to create a new folder called "C:\PCUpdates". I found this code and it seems to cover most of the issue, but is externally stored. If possible, I'd like to re-code it to run within the AutoIT executable. ' Beginning of Sample VBScript to create a folder and ' assign user permissions Option Explicit Dim objFSO, objFolder, objShell, strDirectory Dim strHome, intRunError strDirectory = "c:\PCUpdates" ' Create the File System Object Set objFSO = CreateObject("Scripting.FileSystemObject") ' Note If..Exists. Then, Else ... End If construction If objFSO.FolderExists(strDirectory) Then Set objFolder = objFSO.GetFolder(strDirectory) 'WScript.Echo strDirectory & " already created " Else Set objFolder = objFSO.CreateFolder(strDirectory) 'WScript.Echo "Just created " & strDirectory End If Set objShell = CreateObject("Wscript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strDirectory) Then ' Assign user permission to home folder. intRunError = objShell.Run("%COMSPEC% /c Echo Y| cacls " & strDirectory & " /t /c /g Everyone:F ", 2, True) End If WScript.Quit ' End of Sample VBScript to create a folder with error-correcting CodeThis is my current AutoIT executable.If Not IsAdmin() Then RunAsSet('administrator', @Computername, 'Password') EndIf RunWait(@ComSpec & ' /c "C:\TEMP\Zen10\NewFolder.vbs"', @SystemDir, @SW_HIDE) 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