Jump to content

Quick help needed with Array Dir Creation


Recommended Posts

Below is the code I'm trying to get it to work. Somehow it fails and I can't figure out what is wrong... Yet again, I ask kindly for your help :P

#include <GUIConstants.au3>
#Include <File.au3>
#Include <Array.au3>

$sFilePath = "C:\PELogonNames.txt"

Dim $usernames

$intWindowWidth = round(200, 0)
$intWindowHeight = round(130, 0)    
$objWindow = GUICreate("Directories", $intWindowWidth, $intWindowHeight)

GUISetState()

$Roaming = GUICtrlCreateButton("Roaming", 40, 100, 120, 25)

GuiSetState()

While 1
$Msg = GUIGetMsg()
Switch $msg 


Case $Roaming
    _FileReadToArray($sFilePath, $usernames)
    For $i = 1 to $usernames[0]
    DirCreate('C:\Profiles\' & $usernames)
    ProgressOn("Progress Meter", "", "0 percent")
    RunWait("CACLS C:\Profiles\" & $usernames & " /E /T /C /G " & $usernames & ':F', '', @SW_LOCK)
    RunWait("cacls.exe C:\Profiles\" & $usernames & " /E /R 'CREATOR OWNER'", '')
    ;RunWait('dirquota.exe quota add /path:"C:\Profiles\"' & $usernames & ' /sourcetemplate:"_TUS - 300 MB - Profiles"', '',@SW_HIDE)
    ProgressSet( Round(1 / 1 * 100, 0), Round(1 / 1 * 100, 0) & " percent")
    ProgressSet(100, "Done", "Complete")
    Sleep(500)
    ProgressOff()
Next

Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...