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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import user list.txt file & net share command.

Status
Not open for further replies.

msidhom

MIS
Jan 23, 2003
1
AU
Hi all, I'm new to scripting and I was wondering if anyone can help me out.

We have a number of Windows that are running out of space and I would like to move the users home folder which are shard as (username$) don't ask me why before my time. I have done this with a long batch file and I think using a VB script would be the smart way to go.

Task

1. Using the dos command (net share username$ /del) stop all the current user shares by import a userslist.txt file (which will contain a list of all the users).
2. Robocopy the user folder to new location (will do this manually).
3. Using the command (net share username$=d:\users\username) to recreate the shares by also utilizing the userslist.txt file.

Thank you very much in advanced for you help with this
 
You can use VBScript but it will end up running the net commands in a shell so you'd actually be better off using DOS.

Tips:
1) DOS commands on NT/2K/XP are more advanced than the ones on 95/98/ME
2) if statements can go over several lines: use ( and ) to group them.
3) help on all commands can be obtained with /?
4) all the subroutines can be created locally. To call put a : before the routine name. To return goto :EOF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top