Jump to content

How do I make a batch script do multiple things?

I have two PC's, one is Server 2012 and is a domain controller, the other is a Windows 10 client joined to the domain. I have a script that has the following lines:

 

Net Use Z: \\CKIA_Srvr1\ScriptShare

Net time \\CKIA_Srvr1 /set /yes

 

I want the script to create the mapped drive upon logging in, and synchronize the client's time with the domain controllers. In Active Directory Users and Computers, I have User06's Profile Logon script set to User06.bat, which contains the above two lines. When User06 logs in, the drive is created, the the time is not synchronized. If I type \\CKIA_Srvr1\netlogon\user06.bat into an elevated command prompt, it works fine and syncs the time. What am I doing wrong here and what do I need to do so that a script handles both of these actions for a user when logging in? Thank you.

 

Edit: It seems my problem isn't the script, it's a rights issue or something. When I run the script in a non-admin prompt it gives "System error 1314 has occurred. A required privilege is not held by the client". How do I go about fixing that?

Link to post
Share on other sites

Question, does the server have Group Policy or DHCP? We you can do with DHCP is set a time server in the DHCP Options so that time is sync automatically.

 

Reason I ask for Group Policy is you can map the drive that way instead of using the script, or either use AD to map the drive on logon, unless you need to use scripts :)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×