Jump to content

Recommended Posts

Posted

Hello,

I need to process a list of usernames, create home directories, set permissons, etc. I'm a newbie and I'm stuck at creating the directories. Any ideas? Everything is working fine until the Run command - thanks in advance! :whistle:

; Read in lines of text until the EOF is reached

While 1

$line = FileReadLine($file)

If @error = -1 Then ExitLoop

$parse = StringInStr($line, "@")

; MsgBox(0, "char number:", $parse)

$realnum = $parse - 1

$name = StringLeft($line, $realnum)

;MsgBox(0,"name",$name)

;Run(@ComSpec & "/c " & " md \\geo\DATAVOL\geohome\$name")

Run(@ComSpec & "/c md \\geo\DATAVOL\geohome\$name")

Wend

jc

Posted

Why not just use DirCreate.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted

Why not just use DirCreate.

Ahh...because I'm new - Thanks! That works..but, now I'm getting my variable name ($name) created instead of the variable. Must be another dopey new question, but I'll look on my own till an easy answer comes along.

Thanks again!

Posted (edited)

Try using $name instead of "$name", just a wild guess.

Edit

Or "\\geo\DATAVOL\geohome\" & $name instead of "\\geo\DATAVOL\geohome\$name"

Edited by BigDod


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted

Try using $name instead of "$name", just a wild guess.

Edit

Or "\\geo\DATAVOL\geohome\" & $name instead of "\\geo\DATAVOL\geohome\$name"

That did it - I was removing the quotes, but not using &. Great - Thanks BigDod..... I may be back for more. I owe you a beverage.

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
×
×
  • Create New...