login script to run an exe file while logging on

Hi all
I am running windows server 2003 ent edition with AD.  I use 'login.bat' to install and map all the network drives.  I have an '.exe' file which I want to run while any user logs in.  How can I do that through my 'login.bat' or any other way through the AD.
amanzoorNetwork infrastructure AdminAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi amanzoor,

Use the Call commmand.

CALL C:\yourprogram.exe

If there are spaces in the path use:

CALL "C:\Program Files\yourprogram.exe

Lee W, MVPTechnology and Business Process AdvisorCommented:
Just put it in.  Have you tried that?
in your login bat, add this line


of course, change c:\dir\notepad.exe to the executable you desire to run.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!


Try it on test user first.

the location server followed by the exec
Lee W, MVPTechnology and Business Process AdvisorCommented:
CALL is typically used for batch files - I've not see it used with EXEs.

If the EXE is hanging the logon script because it continues to run, then use the START command -

START yourprogram.exe


leew is correct.

CALL is used for batch files in batch files.  In order to use the program you would use the START command.  This will allow the program to run (like a TSR).
Sam PanwarSr. Server AdministratorCommented:
- Create a batch file called "netlogon.bat" in this folder:
  "c:\documents and settings\all users\start menu\programs\startup"
- Create a batch file \\YourServer\SomeShare\login.bat
- Put these lines into it:
  @echo off
  \\YourServer\SomeShare\psexec.exe  \\PC1 c:\Tools\SomeCommand.exe

@echo off
net use x: \\ace-file01\SHARED
if exist x:\InventoryData\AceAssets\clientcon.exe
(unwrap this line!)
net use x: /d

- On PC2..9, create a task under the Task Scheduler to
  invoke \\YourServer\SomeShare\login.bat.
- Tell the Task Scheduler to run the task at logon time.

Note that you must schedule the task under and account
name / password that is valid on PC.

You can get psexec.exe from www.sysinternals.com.It's free.

- Put the following lines into netlogon.bat:

Other scripts sites:

leew , matricii, are correct Call would leave the logon.bat hung until the exe that was called ended all that is needed is the start c:\???.exe
thereby ending the logon.bat after starting the exe
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.