-
June 14th, 2010, 07:25 PM
#1
Junior Member
Need help on create a batch file
Hi everyone,
I have a lab practices about using scripts that I need help on.
Contoso has 20 seperate locations in the United States, and each location is being equipped with a new file server. The file servers are going to have six shared folders, which will have the same names regardless of location. You need to create a batch file that automatically creates these six shares. Once the shares are created, on-site technicians will set the permissions manually according to their needs.
To complete thsi lab challenge, do the following:
1. Write a batch file named SharedFolders.bat that uses the Net Share command to share the following folders. The share name and folder name should be the same, and the folders should be located in C:\Standard Shares\
- Financial
- Marketing
- Support
- Miscellaneous
- Legal
- Customer Support
2. Run the batch file
3. Verify that your partnet has successfully run the batch file by accessing the shared folders on your partner's computer from a Run dialog box
This is from Microsoft Windows XP Pro lab manual, I've never did batch file before. I would like some help on it.
Thanks.
-
June 14th, 2010, 10:07 PM
#2
Junior Member
I wrote this and its work, first it work for the 6-subfolder inside "Standard Shares" but it doesn't work on Standard Shares. After awhile, I delete the batch file and create a new batch file and it work for all 7-folders.
cd\
md "C:\Standard Shares"
cd "Standard Shares"
md Financial
md Marketing
md Support
md Miscellaneous
md Legal
md "Customer Support"
cd\
net share "Standard Shares"="C:\Standard Shares"
net share Financial="C:\Standard Shares\Financial"
net share Marketing="C:\Standard Shares\Marketing"
net share Support="C:\Standard Shares\Support"
net share Miscellaneous="C:\Standard Shares\Miscellaneous"
net share Legal="C:\Standard Shares\Legal"
net share "Customer Support"="C:\Standard Shares\Customer Support"
cd\
thx,
-
June 14th, 2010, 11:26 PM
#3
Really? That works... WOW. And who deleted my previous post?
09:F9:11:02:9D:74:E3:5B 8:41:56:C5:63:56:88:C0
-
June 15th, 2010, 12:15 AM
#4
Originally Posted by hacmiu
I wrote this and its work, first it work for the 6-subfolder inside "Standard Shares" but it doesn't work on Standard Shares. After awhile, I delete the batch file and create a new batch file and it work for all 7-folders.
Ok, I might be misunderstanding your issue here. Are you saying that the subfolders inside 'C:\Standard Shares' are shared properly, but that the 'Standard Shares' share is not working? [I might have just confused myself further with this post! ]
Either way, welcome to AO!
\"Those of us that had been up all night were in no mood for coffee and donuts, we wanted strong drink.\"
-HST
-
June 16th, 2010, 06:24 PM
#5
net share "Standard Shares"="C:\Standard Shares"
Syntax is incorrect and command is incomplete
I was being a smart ass... The bat file above does not share the folders.
09:F9:11:02:9D:74:E3:5B 8:41:56:C5:63:56:88:C0
-
June 17th, 2010, 04:11 PM
#6
Junior Member
the "Standard Shares" does not share when I first created, the folder shared when I edit
cd\
md "C:\Standard Shares"
cd Standard Shares" (leave the open quote out)
md Financial
...
and the other way that I did was copy the whole thing to a new ".bat" and it work (on first attempt)
-
June 26th, 2010, 07:59 PM
#7
reduced to batches, nao? wtf? I don't even? EI rly brought this place down.
GIVE BACK TO JP...also, bring back snacks.
Every now and then, one of you won't annoy me.
Similar Threads
-
By xierox in forum Other Tutorials Forum
Replies: 0
Last Post: March 5th, 2005, 05:34 AM
-
By Deimos326 in forum Other Tutorials Forum
Replies: 3
Last Post: December 7th, 2003, 11:18 PM
-
By ele5125 in forum Other Tutorials Forum
Replies: 9
Last Post: June 19th, 2002, 05:09 PM
-
By smirc in forum AntiOnline's General Chit Chat
Replies: 6
Last Post: May 13th, 2002, 04:35 PM
-
By Badassatchu in forum Non-Security Archives
Replies: 1
Last Post: November 23rd, 2001, 11:13 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|