mist3r Posted July 4, 2006 Posted July 4, 2006 Im trying to make a script that will basically delete the users profile. There are accounts on the server as User01 User02 > User20 $message = "Deleting all User Profiles" SplashTextOn("DELETE SCRIPT", $message, -1, -1, -1, -1, 4, "") For $x = 1 to 20 DirRemove ( "C:\Documents and Settings\User"& $x &"",1) $message = $message & $x & @LF ControlSetText("DELETE SCRIPT", "", "Static1", $message) sleep(100) Next This will work for deleting all the users 10 to 20. I thought about adding something like IF $x < 10 THEN $x = 0$x //Basically making the $x = 01 instead of 1 to delete the User01. Im a n00b and have searched the help file high and low about attatching 1 string to another and cant figure it out Sorry if this is stupid, any advice is much appreciated! Cheers
Briegel Posted July 4, 2006 Posted July 4, 2006 Try this: $message = "Deleting all User Profiles" SplashTextOn("DELETE SCRIPT", $message, -1, -1, -1, -1, 4, "") For $x = 1 to 20 If StringLen ( $x ) = 1 Then $x = '0' & $x DirRemove ( "C:\User\User"& $x &"",1) $message = $message & $x & @LF ControlSetText("DELETE SCRIPT", "", "Static1", $message) sleep(100) Next
mist3r Posted July 4, 2006 Author Posted July 4, 2006 WooHoo! Briegel your a star mate. Thanks for that! Now i know how to add to the string n the stringlength is a much better way of doing it. Cheers
Briegel Posted July 4, 2006 Posted July 4, 2006 Thanks mist3r, but I am one of the smallest 'autoiter'. Without help from this forum I can't surviving. Next time perhaps you have to help me.
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