Need solution automate setting a share

paulkruger

New member
Member
Local time
7:06 PM
Messages
69
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.:D
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Various including DIY
OS
Wind7 64 x 3 | Win Vista 32 | Ubunto
CPU
AMD 4 core | Intel i7 2600 4 core | and some others
Memory
16 GB where possible
Graphics Card(s)
Nvidia 740 2GB | Nvidia 730 4GB
Monitor(s) Displays
20" x 2 on both main. (Dual monitors DVI )
Hard Drives
LOTS OF THEM!
Keyboard
QWERTY
Mouse
Yes
Internet Speed
80GB down 10GB up
Browser
Firefox,Chromium,Opera,Safari, IE(ugh)
You won't loose the share if you use persistent switch
 

My Computer

Computer type
PC/Desktop
OS
win 8 32 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 Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Dell M6500 Precision Work Station
OS
Windows 7 Pro SP1 64 bit
Memory
8 GB
Screen Resolution
1920x
Internet Speed
30 Mbps
Antivirus
Norton Security
Browser
IE 11
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Various including DIY
OS
Wind7 64 x 3 | Win Vista 32 | Ubunto
CPU
AMD 4 core | Intel i7 2600 4 core | and some others
Memory
16 GB where possible
Graphics Card(s)
Nvidia 740 2GB | Nvidia 730 4GB
Monitor(s) Displays
20" x 2 on both main. (Dual monitors DVI )
Hard Drives
LOTS OF THEM!
Keyboard
QWERTY
Mouse
Yes
Internet Speed
80GB down 10GB up
Browser
Firefox,Chromium,Opera,Safari, IE(ugh)

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Dell M6500 Precision Work Station
OS
Windows 7 Pro SP1 64 bit
Memory
8 GB
Screen Resolution
1920x
Internet Speed
30 Mbps
Antivirus
Norton Security
Browser
IE 11

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Various including DIY
OS
Wind7 64 x 3 | Win Vista 32 | Ubunto
CPU
AMD 4 core | Intel i7 2600 4 core | and some others
Memory
16 GB where possible
Graphics Card(s)
Nvidia 740 2GB | Nvidia 730 4GB
Monitor(s) Displays
20" x 2 on both main. (Dual monitors DVI )
Hard Drives
LOTS OF THEM!
Keyboard
QWERTY
Mouse
Yes
Internet Speed
80GB down 10GB up
Browser
Firefox,Chromium,Opera,Safari, IE(ugh)
Just use
net use * "\\server\my media" /persistent:yes
 

My Computer

Computer type
PC/Desktop
OS
win 8 32 bit
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
diy
OS
Win7 pro x64
CPU
stock i7 7700k
Motherboard
Gigabyte Z270N-WIFI mini-ITX
Memory
Corsair Vengeance LPX 16GB (2x8GB) DDR4 @ 3200MHz
Graphics Card(s)
integrated Intel HD 630
Sound Card
onboard Realtek ALC1220
Monitor(s) Displays
two vertically mounted samsung 55" 4k un55mu8000
Screen Resolution
1920x1280
Hard Drives
256GB Samsung EVO 960 M.2 pci-e NVMe SSD
PSU
SilverStone Nightjar ST45NF 450Watt Fanless
Case
No case. Motherboard is mounted directly onto power supply
Cooling
Evercool low profile 815EP with Panaflow 12L fan at 7v
Keyboard
Ortek MCK-86 mini
Mouse
Belkin 5-button USB
Internet Speed
spectrum 400mbps
Back
Top