Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move Folder Script

Status
Not open for further replies.

quinla01

IS-IT--Management
Nov 1, 2005
20
0
0
GB
Hi guys, I'm not a scripter however someone kindly wrote the below script for me a while back. It allows me to enter a username (via input box) and moves the related home directory from the user Home Directroy Folder to a subfolder named "disabled folders". I'm now in the situation were i have a text file of 900 users. I was hoping somone could help me ammend the script to use the text file as username input.

==================================

Dim strUserName, objFSO

strUserName = ""
strUserName = InputBox("Enter User Name", _
"Migrate User Profile", strUserName)

Set objFSO = CreateObject("Scripting.FileSystemObject")


IF objFSO.FolderExists("\\sspct-fs01\users$\"&strUserName) THEN

IF Not objFSO.FolderExists("\\sspct-fs01\users$\disabledusers\Mig."& strUserName) Then

objFSO.MoveFolder "\\sspct-fs01\users$\"& strUserName , "\\sspct-fs01\users$\disabledusers\Mig."& strUserName

'WScript.Echo "The profile has been renamed: Mig."&strUserName & " and moved to the location \\sspct-fs01\users$\disabledusers"

ELSE WScript.Echo "The folder del."& strUserName & _
" Already exist in the within the folder \\sspct-fs01\profiles$\MigratedProfiles.Manually delete the older profile and try again"

End If

ELSE

WScript.Echo "The profile folder " &strUserName & " does not exit"

End If



=================================


Thanks Guys

Andy
 
Its a bit beyond me that one.,,

Thanks Anyway
 
The other thing that would help would be for the script not to close when i click ok (once i enter text into the input box) that way i could repeat the process over and over again.

thanks
Andy
 
do while loop, take a look at the url PHV suggests, it is not that hard honest. you just need to take the time to really really read it and really really read the code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top