stoping the execution of a batch file after X seconds

SmallguySmallguy Member Posts: 597
Hi everyone

I'm wondering what the syntax is for ending a script aft X seconds.

the reason being is one of our clients has a script that was written to do a system inventory but that script is causing log on times of 45 minutes at times. If I remove the script logon times are normal.

the script is as follows

start \\servername\ishareddiectory\inventoryapp.exe

so it is nothing fancy

I want to somehow say IF time running >= 30seconds Then Quit but I'm' not sure of what the syntax is and my knowledge of scripting is very limited


any help and resources is appreciated

Comments

  • CorySCoryS Member Posts: 208
    for batch files i think the command is

    wait <seconds>
    MCSE tests left: 294, 297 |
  • SmallguySmallguy Member Posts: 597
    I asked the same thing overt code project and was told it is not possible once the exe file is run

    they said it would have to be something the .exe supported and through it;s config
  • sprkymrksprkymrk Member Posts: 4,884 ■■■□□□□□□□
    Instead of running it inside the logon script, can you run it seperately?

    I wonder what would happen if you used something like this in your logon script:

    cmd /c start \\servername\ishareddiectory\inventoryapp.exe

    That may open a new cmd prompt to run the application, and as soon as it launches (rather than finishes) continue on with the rest of the logon script.

    Not sure, but just a thought that came to me. Might be worth a try.
    All things are possible, only believe.
  • shednikshednik Member Posts: 2,005
    sprkymrk wrote:
    Instead of running it inside the logon script, can you run it seperately?

    I wonder what would happen if you used something like this in your logon script:

    cmd /c start \\servername\ishareddiectory\inventoryapp.exe

    That may open a new cmd prompt to run the application, and as soon as it launches (rather than finishes) continue on with the rest of the logon script.

    Not sure, but just a thought that came to me. Might be worth a try.

    We tried something like this at my last company with Inuit's Track IT software...they have a workstation audit feature. I think when I tested logging in it took me roughly 6 mins I don't remember the specifics maybe run it as a service once logged in like from the programs -> start up?? worth a try..
Sign In or Register to comment.