Computing.Net > Forums > Windows Server 2003 > Move Directory Script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Move Directory Script

Reply to Message Icon

Name: quinla01
Date: March 7, 2006 at 07:55:13 Pacific
OS: NA
CPU/Ram: NA
Product: NA
Comment:

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



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Public Folder access prio... ISA 2004 / Real Player



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows Server 2003 Forum Home


Sponsored links

Ads by Google


Results for: Move Directory Script

Login Scripts by membership www.computing.net/answers/windows-2003/login-scripts-by-membership/6110.html

Logon scripts run slowly www.computing.net/answers/windows-2003/logon-scripts-run-slowly/5962.html

Batch script to move/delete files www.computing.net/answers/windows-2003/batch-script-to-movedelete-files/6453.html