Solved

Windows Script Help - 2k3 Login.bat

Posted on 2007-03-29
5
166 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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 …
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

770 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