Quote:
I see this:
Code:
Select
Case
$veruser="admin"
Case $veruser <> @WKSTA
$errmsg="INVALID USER-You are NOT authorized to run this application"
Call $runerr
Exit 0
EndSelect
Are you missing an action for the first case ($veruser="admin")? If not, then something like this may be better.
Code:
If $veruser <> @WKSTA
$errmsg="INVALID USER-You are NOT authorized to run this application"
Call $runerr
Exit 0
EndIf
Also, you have several separate if block to check for and create directories. This would be a good place to have a UDF or at least a loop to condense the script by a few lines. I used some junk values for testing.
Code:
$localscripts = "c:\junk12"
$readlog = $localscripts + "\morestuff"
$netlogs = $readlog + "\deeperYet"
; make array of directory values
$myDirs = $localscripts, $readlog, $netlogs
For Each $dir In $myDirs
? $dir
If NOT Exist ($dir)
MD $dir
;Check the value of @ERROR to see if MD was successful (@ERROR = 0).
;Handle error if one occurs.
EndIf
Next
I am using the case select without an action to allow the admin features to be accessed. I originally had the <> and this would force the Invalid User message to appear.
Thanks for the array to generate the directories. Will be added.
_________________________
I haven't failed. I just found another way that did not work.