Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Need solution automate setting a share

22 Mar 2019   #1
paulkruger

Wind7 64 x 3 | Win Vista 32 | Ubunto
 
 
Need solution automate setting a share

Good day!


Was wondering if anyone knows of a way to write a batch file to set up a network share on a drive with a single click.


I have an encrypted container for bookkeeping and financial stuff that when mounted, needs to be accessible from another computer on LAN.


Any settings for a share are, of course, lost on dismount so each time I have to go to the drive/sharing/advanced sharing. There I remove "everyone" and replace with "NETWORK" will all permissions.


I'm lazy.


I would love to have a batch file, script that when clicked after mounting said drive will apply all the necessary share settings for me on the specific drive letter I always assign to that drive.


Anyone know if or how this can be done?


Thanks much.


My System SpecsSystem Spec
.
22 Mar 2019   #2
samuria

win 8 32 bit
 
 

You won't loose the share if you use persistent switch
My System SpecsSystem Spec
22 Mar 2019   #3
wither 2

Windows 7 Pro SP1 64 bit
 
 

If you go to the Control Panel, Network and Sharing, do you have File Sharing enabled? That should be done on the computer which defines the Network.
My System SpecsSystem Spec
.

23 Mar 2019   #4
paulkruger

Wind7 64 x 3 | Win Vista 32 | Ubunto
 
 

Sounds like a way to get to where I want to go. Yes sharing is on by default so it is obvious there needs to be more than that to "remember" a drive letter that is not always there which is why I was thinking I might need a batch file or something to apply the share after mounting the volume.


If either of the replies can provide more info on how to accomplish this please let me know.


Thanks
My System SpecsSystem Spec
23 Mar 2019   #5
wither 2

Windows 7 Pro SP1 64 bit
 
 

I'm going to leave this one to samuria. I found this-

Net Use Command (Examples, Options, Switches, and More)

but have no idea if that is going to help you.
My System SpecsSystem Spec
23 Mar 2019   #6
paulkruger

Wind7 64 x 3 | Win Vista 32 | Ubunto
 
 
Still confused :)🚻

Quote   Quote: Originally Posted by wither 2 View Post
I'm going to leave this one to samuria. I found this-

Net Use Command (Examples, Options, Switches, and More)

but have no idea if that is going to help you.

Now I am even more confused! I guess Im too dumb to figure it out so will stick with the old way for now!
My System SpecsSystem Spec
23 Mar 2019   #7
samuria

win 8 32 bit
 
 

Just use
net use * "\\server\my media" /persistent:yes
My System SpecsSystem Spec
24 Mar 2019   #8
johnhoh

Win7 pro x64
 
 

Quote   Quote: Originally Posted by samuria View Post
Just use
net use * "\\server\my media" /persistent:yes
you create a file called share.cmd and put it on your desktop. It has to be a .cmd file, not .txt, not .doc. Put only one line in it, for instance the line samuria has above. Then when you click on the share.cmd file, the line gets executed.
My System SpecsSystem Spec
Reply

 Need solution automate setting a share




Thread Tools




Similar help and support threads
Thread Forum
Unidentified Network when setting IP address to static - solution!
Finally found a solution to my static IP issue. Whenever I would set my IP to static, the network would become Unidentified. To get the network back to Home I would change to DHCP, then back to static. After waking the computer up from Sleep mode it would go back to Unidentified. Since it didn't...
Network & Sharing
Setting up Network with share options
My Windows 7 system had a primary hard disk failure; the seconddisk was okay. A new disk was installed and Windows 7 professional installed onit. So I have Disk 1 with Partition C containing Windows and programs andPartition P containing Data. Disk 2 with Partition D containing programs...
Network & Sharing
cmd.exe, share setting
Hi, the problem I have is that cmd.exe has different setting depending on how it's launched. If I launch it directly or from the search box it will take its setting from HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe If I launch if from the shortcut in the start menu its setting will...
Software
How to Automate ASC 4?
I want to know how can i automate the running process of Deep Care. I have already searched the folder, but it doesn't have the Deep Care shortcut. I have to run ASC 4 and from the main menu open Deep Care, and then select Scan and Repair. I wanted a shortcut that goes to Scan and Repair, and to...
General Discussion
Someone automate this for me?
Hi there, wondering if this is possible to create as a .bat file or something here is the code: I can type it in with CMD but I'm running this on many computer so I want it to be faster.
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 18:14.
Twitter Facebook