Solved

Windows Script Help - 2k3 Login.bat

Posted on 2007-03-29
5
167 Views
Last Modified: 2010-04-16
My company has several different offices with applications that run from the local DCs and file servers.  I wrote a script to determine which branch a workstation was at and would process a login script accordingly.  The script seems to run most of the time, but there are a few sporatic workstations that either don’t run the script at all or run the wrong script.  Any and all improvements or recommendations would be greatly appreciated.

Thanks in advance.

Below are examples of the scripts I am using:

================================================
MAIN SCRIPT:

@ECHO OFF
CLS

if exist c:\site1.txt CALL //site1/SYSVOL/COMPANY.NET/SCRIPTS/site1.BAT GOTO EOF

if exist c:\site2.txt CALL //site2/SYSVOL/COMPANY.NET/SCRIPTS/site2.BAT GOTO EOF

if exist c:\site3.txt CALL //site3/SYSVOL/COMPANY.NET/SCRIPTS/site3.BAT GOTO EOF

if exist c:\site4.txt CALL //site4/SYSVOL/COMPANY.NET/SCRIPTS/site4.BAT  GOTO EOF

:EOF
EXIT

===================================================
SITE1 SCRIPT

@ECHO OFF
CLS

Net Time \\site1 /set /yes

rem *** Remove any existing mapped drives used in the logon script:
for %%a in (g n o p r s t u x) do net use %%a: /delete >nul 2>nul
rem *** Make drive mappings non-persistent:
net use /persistent:no

Net Use o: \\site1\documents\
Net Use u: \\site1\apps$\application
Net Use N: \\site1\apps$\

ipconfig >c:\site1.txt
echo ************************************** >>c:\site1.txt
echo ***%date%***%time%***%computername%***%username%*** >>c:\site1.txt
echo ************************************** >>c:\site1.txt

call \\site1\sysvol\company.net\scripts\site1Printer.vb

EXIT
0
Comment
Question by:AzagThothe
  • 2
5 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18818818
Perhaps it's permissions in that the user can't set the time on their system?
0
 

Author Comment

by:AzagThothe
ID: 18818944
Domain users are part of the local admin group on every workstation.
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18832985
What about the policy though to prevent changing system time - is that somehow disabled for local users?
Start->Run->secpol.msc - under User Rights Assignment - who has access to change system time?

For testing also - I would try just the net time command on one of those workstations - note the results when run manually using that account.

You might also adjust your logon script temporarily - remove the @echo off (so you can see the processing) and place a pause after the net time /set - so that you can determine any errors...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question