Pegasus said:
Rich Pasco said:
Pegasus (MVP) wrote:
Pegasus (MVP) wrote:
My Startup Group for "All Users" contains a shortcut to a BAT file.
When a member of group "Administrators" logs in, it executes just fine.
When a member of group "Users" logs in, he gets the response "no
application is associated with the file..." If this same user later
manually clicks on the same shortcut, the BAT file executes correctly.
So why won't it execute when he is first logging in? That is
what
the
Startup Group is for.
I'm running Microsoft Windows 2000 [Version 5.00.2195].
- Rich
Let's have a look at your startup batch file! You are most likely
trying to invoke some application by relying on an association
that is not present at that stage. For example, instead of coding
like so:
notepad c:\SomeFile.txt, you code like so:
c:\SomeFile.txt
Unless Windows knows that all .txt files must be opened with
notepad.exe, the batch file will fail.
None of that in my batch file. The entire BAT file is two lines:
@echo off
echo %username% > c:\logfiles\login.log
It works fine if I manually click on its icon in the Startup group.
- Rich
It is not possible for the "echo" command to generate the error
message "no application is associated with the file". There must
be something else lurking in the corner. I suspect that the error
message is not generated by this batch file but by another batch
file that you're not aware of. You can easily prove it: Make the
second line a "pause" line. I bet you will find that the batch file
never pauses!
You should also turn "echo on", not off, to make things visible.
The problem I have been asking for help with is that Windows can find no
association with the BAT file itself--which I suppose should be cmd.exe.
You've been trying to debug the content of my BAT file, when my problem
is getting Windows to run it at all. In other words, the problem is not
within the BAT file, it's getting it to execute in the first place.
So I replaced the BAT file with this one:
pause
echo hello
and as you predicted it didn't pause.
So back to square one: What is preventing Windows from executing this
(or any) BAT file? To recap:
- If I later open the Startup group and click on the shortcut icon,
the BAT file executes correctly. The problem happens only when I
first log in.
- If I log in as a different user, with Administrator privilege,
then the BAT file executes automatically (via its Startup group
shortcut).
- Rich
You now believe that Windows cannot execute netlogon.bat because
it fails to resolve the .bat extension at startup time. You can easily
prove it, by doing this:
- Place a copy of notepad.exe into the netlogon folder and into the
"All Users" Startup folder.
- Replace "netlogon.bat" with "notepad.exe" in the logon script field
of the user profile.
- Log on. What happens?
I would also like to know the contents of the user's personal
startup folder. What exactly is there?
No, I never said anything about netlogon.bat -- in fact, I've never
heard of that file. I named my batch file "login.bat"; any resemblance
to any other filename is purely coincidental.
The entire content of this startup group is as follows:
Inherited from "all users":
eFax.com tray menu
Live Menu (also part of eFax system)
Acrobat Assistant Speed Launch
Adobe Reader Speed Launch
login.bat (subject of this thread)
Unique to this user:
(none)
The other applications (eFax and Acrobat) launch fine.
Please note there is no shortcut to netlogon.bat whatsoever.
I added, to the "all users" startup group, a shortcut to
%windir%\system32\notepad.exe
and now, when my troubled user logs in, a new Notepad session
starts as expected.
But Windows still complains,
c:\profiles\login.bat
This file does not have a program associated with it for performing
this action. Create an association in the Folder Options control
panel.
- Rich