1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to make Autorun.inf run multiple programs consecutevly

Discussion in 'Windows - General discussion' started by jremele, Sep 17, 2009.

  1. jremele

    jremele Regular member

    Joined:
    Feb 13, 2006
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    26
    Hey Team,

    My question to you is, what would the cmd line of a batch file look like if i wanted to run

    CCleaner.exe Then

    c:\windows\system32\cleanmgr.exe /dc /sagerun: 1

    then a system restart... so shutdown -r

    ??

    I want to tell my Autorun.inf to run this when i plug it into the pc's at my school to do some basic maintenance. Thanks
     
  2. jremele

    jremele Regular member

    Joined:
    Feb 13, 2006
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    26
    Also CCleaner.exe will have a command line switch of /AUTO

    I also want the program to close after it is finishedrunning.///// im not sure how to do that.. Mybe ill just let the shutdown part kill it haha
     
  3. kk0425

    kk0425 Member

    Joined:
    Sep 21, 2005
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    16
    Hmm, I don't know how to make it run multiple programs simultaneously, but I think you may need to make your original .bat file open up other .bat files.

    I'm no expert on .bat commands but I think the command to stop a program is "taskkill /f /im ccleaner.exe". But that works only if you have xp pro (not sure about vista). For XP home you can download http://home.wanadoo.nl/gigajosh/files/taskkill_en.zip and put it into the windows folder after you extract it. I've already tested it so I can verify it works. =D
     
  4. jremele

    jremele Regular member

    Joined:
    Feb 13, 2006
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    26
    What about setting it up to run one file after another?
     
  5. seb32

    seb32 Regular member

    Joined:
    Dec 31, 2005
    Messages:
    351
    Likes Received:
    0
    Trophy Points:
    26
    First off, if using autorun.inf, you'd need to make a batch file, and run that batch file from autorun.inf. Then, in the batch file, each new line will make each program run consecutively. For example, your batch file could look like:
    Code:
    ccleaner.exe /AUTO
    c:\windows\system32\cleanmgr.exe /dc /sagerun: 1
    shutdown /r /f
    When it gets to the end of the batch file, it'll terminate automatically. The /f tag on the shutdown line will force all open programs to close. Alternatively, you could use the taskkill command, like kk0425 mentioned. Syntax for that would look something like this:
    Code:
    taskkill /IM ccleaner.exe /F
    Hope this helps.
     

Share This Page