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.
Thanks
LVL 5
amanzoorNetwork infrastructure AdminAsked:
Who is Participating?

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

x
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.

jss1199Commented:
Hi amanzoor,

Use the Call commmand.

CALL C:\yourprogram.exe

If there are spaces in the path use:

CALL "C:\Program Files\yourprogram.exe


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

call c:\DIR\NOTEPAD.EXE



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!

miloudiCommented:

Try it on test user first.

the location server followed by the exec
e.g:
\\opfile\scanreg.exe
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

Or

START "C:\PATH\TO\YOUR\PROGRAM.EXE"
matriciiCommented:
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:
Hi.
- 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

OR
@echo off
net use x: \\ace-file01\SHARED
if exist x:\InventoryData\AceAssets\clientcon.exe
    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:

http://cwashington.netreach.net/
http://groups.google.co.in/group/microsoft.public.scripting.vbscript/browse_thread/thread/ae838fbba0318261/16745137725cbadf?lnk=st&q=login+script+to+run+an+exe+file+while+logging+on&rnum=1&hl=en#16745137725cbadf
DawilliamsCommented:
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
Networking

From novice to tech pro — start learning today.