Solved

Windows Script Help - 2k3 Login.bat

Posted on 2007-03-29
5
171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

617 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