Sign in to follow this  
Followers 0
skysel

Quick help needed with Array Dir Creation

3 posts in this topic

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

Share this post


Link to post
Share on other sites



Ah stupid me :P I totaly forgot to put [$i] besides the $usernames :unsure: Works now.

Share this post


Link to post
Share on other sites

Hmm..Worked on my computer moments ago, copied to server..doesn't work.. now it doesn't work at my local computer also...am I missing something?

Share this post


Link to post
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
Sign in to follow this  
Followers 0