Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon script runs on one system, partially on another

Status
Not open for further replies.

RKizer

MIS
Feb 15, 2008
11
US
The logon script I have been developing has been running perfectly on the test system doing everything I need it to do. When I tested it on three other systems I only get a partial read of the file.

CODE
ECHO Start LogOnScript.bat >>C:\bravo.txt
date/t >>C:\bravo.txt
time/t >>C:\bravo.txt
ECHO run LogOn1.vbs >>C:\bravo.txt

cscript \\Server\SYSVOL\HOME.COM\Scripts\LogOn1.vbs >>C:\bravo.txt

start /b Outlook.exe /importprf \\Server\Users\PRF\Mail.PRF

Echo script End >>C:\bravo.txt
Echo ********** >>C:\bravo.txt

The script file maps network drives, adds printers, etc.
The next command loads an Outlook profile. I get a log file output to the local system to confirm the whole script ran.

On the other 3 systems, only the Outlook profile portion runs and I get no log file at all, the script file never gets called.

If I copy the .bat file to the other systems and run it locally I get the same result as logging on. If I open a command prompt and manually type the command to run the script it works mapping the drives, etc..

All systems are on the domain and are running WinXp pro. The server is Win2K.

Any help would be appreciated.
 
If you haven't seen Mark's post it is worth looking at.

Is there something you are doing in the batch file that you couldn't just do in the vbscript?

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
The tips have been helpful. I have tried to run the Outlook command in the script, tried it a few ways, but it would not work.

The thing that gets me is that when the batch file runs, it calls the command to open and import the Outlook .prf file and nothing else. No other output. Even if I comment out that command.
 
I figured it out. I had to add to the C drive security properties on the local machine the "Domain Users" group and give them Full Control. The script runs now.
 
Just a suggestion (based on the fact that the idea of giving ordinary users Full Control to C: makes me go "Eek!") but try these changes instead:
Code:
ECHO Start LogOnScript.bat >>C:\%temp%\bravo.txt
date/t >>C:\%temp%\bravo.txt
time/t >>C:\%temp%\bravo.txt
ECHO run LogOn1.vbs >>C:\%temp%\bravo.txt

cscript \\Server\SYSVOL\HOME.COM\Scripts\LogOn1.vbs >>C:\%temp%\bravo.txt

start /b Outlook.exe /importprf \\Server\Users\PRF\Mail.PRF

Echo script End >>C:\%temp%\bravo.txt
Echo ********** >>C:\%temp%\bravo.txt

JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, and so on)[/small]
 
I tried that with no change. I found a way to reset to permissions after the script runs.

CODE
ECHO Start LogOnScript.bat >>C:\bravo.txt
date/t >>C:\bravo.txt
time/t >>C:\bravo.txt

ECHO run LogOn1.vbs >>C:\bravo.txt

cscript \\Server\SYSVOL\HOME.COM\Scripts\LogOn1.vbs >>C:\bravo.txt

start /b Outlook.exe /importprf \\Server\Users\PRF\Mail.PRF

:: change security permissions
ping 1.1.1.1 -n 3 -w 2000 > nul

Echo Y| cacls C:\ /p "domain users":r "System":F "administrators":F >>C:\bravo.txt


Echo ***********script End************ >>C:\bravo.txt

This works well enough for our needs.
Any thoughts?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top