Lori Posted May 6, 2009 Share Posted May 6, 2009 (edited) Just found Autoit and so far impressed but i'm a little week on arrays and asking for help on a small issue. I've written and been using this batch file: @echo off title CDEvans Profile Backup batch file set backupcmd=xcopy /s /c /d /h /i /r /y :EnterUser cls echo - Enter the users profile name for backup - set /p profilename= cls net user %profilename% /domain | find "Full Name" net user %profilename% /domain | find "profile" net user %profilename% /domain | find "Home directory" >> C:\CDE.txt net user %profilename% /domain | find "Home directory" net user %profilename% /domain | find "active" set /p temp= < c:\CDE.txt echo %temp:~29% >> C:\CDE2.txt set /p Home= < c:\CDE2.txt del "C:\CDE.txt" del "C:\CDE2.txt" echo - Trying to open their home drive - start explorer.exe %Home% echo - Is this the correct user? set /p M=type Y,N or Q to quit. if /i %M%==Y GOTO Start if /i %M%==N GOTO :EnterUser if /i %M%==Q GOTO Quit :Start echo - Enter A Driver Letter - set /p Drive= start /wait net use %Drive%: /d start /wait net use %Drive%: %Home% cls %backupcmd% "C:\Documents and Settings\%profilename%\My Documents" "%Drive%:\" %backupcmd% "C:\Documents and Settings\%profilename%\Favorites" "%Drive%:\Favorites" %backupcmd% "C:\Documents and Settings\%profilename%\Local Settings\Application Data\Microsoft\Outlook\*.pst" "%Drive%:\Outlook" %backupcmd% "C:\Documents and Settings\%profilename%\Desktop" "%Drive%:\Desktop" %backupcmd% "C:\Documents and Settings\%profilename%\Application Data\Microsoft\Templates" "%Drive%:\Templates" pause start /wait net use %Drive%: /d GOTO Quit :Quit End However need to add more function to it: This gets me so far: (NOT written by me but I have modded it to do what I want it to, Was written for Citrix server farm data farming. ;------------------------------------------------------------------------------------------------------- ;- - - C O N F I G - - - ;------------------------------------------------------------------------------------------------------- ;Default path to profiles $sXPProfiles = "C:\Documents And Settings\" ;Default path & name for log file $sLogFile = @ScriptDir & "\Profile and Sizes.csv" ;------------------------------------------------------------------------------------------------------- ;- - - I N C L U D E S - - - ;------------------------------------------------------------------------------------------------------- #include <file.au3> #Include <Array.au3> ;------------------------------------------------------------------------------------------------------- ;- - - S T A R T - - - ;------------------------------------------------------------------------------------------------------- ;getting profile path $sXPProfiles = InputBox("Profile Size","Please enter the path to the profiles", $sXPProfiles) if @error <> 0 Then if @error <> 1 Then msgbox(16,"ERROR","The path to the profiles was not entered") EndIf Exit EndIf ;Deleting the log file if it already exists If FileExists($sLogFile) Then FileDelete($sLogfile) EndIf ;writing titles in log file FileWriteLine($sLogFile,"Profile, Size,Last Modified, Computer Name") ;getting list of profiles $aProfileList = _FileListToArray($sXPProfiles, "*", 2) $nNoProfiles = _arrayMax($aProfileList) $nTotalSize = 0 ;Progress ProgressOn("Scanning Profiles", "Scanning Profiles","",-1,-1,18) $nProgress = $nNoProfiles / 100 $i = 0 for $sProfileName In $aProfileList ;Progress ProgressSet(Round($i / $nProgress,0), $i & "/" & $nNoProfiles & " " & $sProfileName) $i = $i + 1 ;Profile size $sProfile = $sXPProfiles & $sProfileName $nProfileSize = DirGetSize($sProfile) if $nProfileSize = -1 Then ContinueLoop EndIf ;Last modified $aModified = FileGetTime($sProfile,0,0) $sModified = $aModified[2] & "/" & $aModified[1] & "/" & $aModified[0] ;total size $nTotalSize = $nTotalSize + $nProfileSize ;log file FileWriteLine($sLogFile, $sProfileName & ", " & Round($nProfileSize / 1024 / 1024,2) & "," & $sModified &) Next ProgressOff() msgbox(0,"Profile Size","Complete! The total size is " & Round($nTotalSize / 1024 / 1024,2) & "Mb in " & $i & " Profiles") ;------------------------------------------------------------------------------------------------------- ;- - - E N D - - - ;------------------------------------------------------------------------------------------------------- What I'm trying to do is merge the two into One. So you get the output of the autoit but then I also need it to backup the users that have had there profiles modded within the last 18 months to there homedrive without user input, just a run and go script. Any ideas or help would be good. Do not write it for me, just pointers to functions I could use to please. Edited May 6, 2009 by Lori Link to comment Share on other sites More sharing options...
muncherw Posted May 6, 2009 Share Posted May 6, 2009 When you say merge them do you mean you want one Autoit script that does what the batch file does as well as what autiit code you have or are you talking about actualling merging something? I don't quite understand the question. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] Link to comment Share on other sites More sharing options...
Lori Posted May 6, 2009 Author Share Posted May 6, 2009 Yeah sorry, I want the autoit script to do the what the batch does as well as the extra, Found a few things thats helped, I'm not near my notes but theres a function to pick a unused drive letter for the network maps, and i'm sure FileReadLine can read the usernames from the csv file to get there homedrives from AD. Link to comment Share on other sites More sharing options...
muncherw Posted May 6, 2009 Share Posted May 6, 2009 Yeah sorry, I want the autoit script to do the what the batch does as well as the extra,Found a few things thats helped, I'm not near my notes but theres a function to pick a unused drive letter for the network maps, and i'm sure FileReadLine can read the usernames from the csv file to get there homedrives from AD.Might want to start with DriveGetDrive to see what's available and use DriveMapAdd to actually map it once you've figured out your free letter. Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic] 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