4OD batch file

Discussion in 'other software & services' started by lodore, Apr 26, 2009.

Thread Status:
Not open for further replies.
  1. lodore

    lodore Registered Member

    Joined:
    Jun 22, 2006
    Posts:
    9,006
    Hello,
    i just installed channel 4 on demand today.
    it wanted to create an autorun entrie and have a service start with windows.
    I deleted the autorun entrie and set the service to manual.

    what i want to do is create a batch file that starts the service "kservice" and then starts the 4 on demand program with the parameters that are normally started.

    so far i have created a batch file which reads as follows:
    @echo off
    NET START Kservice
    path=C:\Program Files (x86)\Kontiki\KHost.exe" -p 4od1 -t cache:c4_home.html#pageId=0 -s class=dialog,width=1280,height=960,position=1,resize=1,scrollbars=1,visible=0,name=main

    i created a shortcut on the desktop that runs the batch file with admin rights.
    the admin rights are needed to start the service.

    for some reason for the program doesnt start.

    I tryed to be sneaky and run the standard shortcut after running the service but i got an access denied 5 message in the output of cmd on vista.

    how can i change the path= line with the program parameters so that the program will start?

    atm the service starts and then the batch file exits without starting the program.

    Is there any way to get the stop batch file (stops the kservice) to run when theprocess KHost.exe ends?

    since im the only one who uses this computer i can also start and stop the service using a admin power shell but an automated way would be better.
     
  2. axial

    axial Registered Member

    Joined:
    Jun 27, 2007
    Posts:
    477
    Unless it's just a cut-and-paste error, it looks like you have a mis-matched quotation mark around the path that would clobber things.
     
  3. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    8,634
    Location:
    NSW, Australia
    lodore,

    Does this work?

    @echo off
    NET START Kservice
    path=C:\Program Files (x86)\Kontiki
    KHost.exe -p 4od1 -t cache:c4_home.html#pageId=0 -s
    class=dialog,width=1280,height=960,position=1,resize=1,scrollbars=1,visible=0,name=main


    There are four lines, the final line wraps in the forum.
     
  4. lodore

    lodore Registered Member

    Joined:
    Jun 22, 2006
    Posts:
    9,006
    Hey brian,
    thanks it works:thumb:
    I added the exit command ona 5th line but it didnt work. the cmd window doesnt close once its done its job.
     
    Last edited: Apr 26, 2009
  5. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    8,634
    Location:
    NSW, Australia
    Try this. Any good?

    @echo off
    NET START Kservice
    path=C:\Program Files (x86)\Kontiki
    start "" KHost.exe -p 4od1 -t cache:c4_home.html#pageId=0 -s
    class=dialog,width=1280,height=960,position=1,resize=1,scrollbars=1,visible=0,name=main
    exit
     
  6. lodore

    lodore Registered Member

    Joined:
    Jun 22, 2006
    Posts:
    9,006
    yup that work thanks.
    khost.exe crashes sometimes when i run the batch file but dont think i can really do anything about that.
     
Loading...
Thread Status:
Not open for further replies.