Page 1 of 1

How to create a Bat file to open and edit folders on server

Posted: 26 Sep 2023 15:20
by STORM
Hi, New here looking for some assistance creating a bat file,

I need to create a bat file for domain users to be able to access certain folders from off the server?
So when they use another users PC on the Domain they can click on the bat file and they can have full access to the folder and their files.
otherwise i have to keep mapping drives direct to the files, when on Holiday Leave or sick leave i still have to dial on to their PCS and map the drive.

for example

user A only has access to Test Folder 1,
User B has access to both Test Folder 1 and Test Folder 2
The server files already have their shares done for the users on the Domain.

How would i write this script, i have attempted and getting this back in the CMD.EXE

The syntax of this command is:

NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[/SMARTCARD]
[/SAVECRED]
[/REQUIREINTEGRITY]
[/REQUIREPRIVACY]
[/WRITETHROUGH]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]

System error 67 has occurred.

The network name cannot be found.

Press any key to continue . . .

...
i have no idea what enter in these boxes other than what i have provided below

@echo off


net use z: \\192.168.15.3\TEST ONLY /user:test.test /PASSWORD: testtest
net use z:\\192.168.15.3\TEST ONLY /PERSISTENT:YES

PAUSE

i'm at a complete loss of what to do next.