• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 14390
  • Last Modified:

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
0
amanzoor
Asked:
amanzoor
7 Solutions
 
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!
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Just put it in.  Have you tried that?
0
 
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.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
miloudiCommented:

Try it on test user first.

the location server followed by the exec
e.g:
\\opfile\scanreg.exe
0
 
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"
0
 
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).
0
 
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
0
 
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now