Kaseya Community

Needing help with creating a procedure to fix default program

  • We are trying to create a procedure that runs these two command line commands:

    ftype JNLPFile=C:\Program Files (x86)\java\jre7\bin\javaws.exe -loadfile "%1"

    regsvr32 /i shell32.dll

    No user interaction is required. I have tried creating a procedure that uses executeshellcommand for each line and run as user or system. The procedure fails. This is to fix the default program for files that have the extension .jnlp. Any advice?

  • From what I can see you might just be just have an issue with your syntax. Best way to test would be manually via command prompt on a system.

    ftype JNLPFile="C:\Program Files (x86)\java\jre7\bin\javaws.exe" -loadfile "%1"

    If I have issue with running commands straight via Kaseya I'll place them in a batch file and kick them off via a Kaseya script.

  • Neal, I have confirmed the command works with command prompt, We are having issues with kaseya running the scripts, I am looking for help with making sure the script works and maybe I am skipping over something simple.

    How do you kick off batch files with kaseya script? my attempts dont seem to work.

    Thank you,

  • From what I can see the first line is used the associate a file type with Java and the second is used to register the Shell32 DLL file.

    The problem that you might be running into I suspect is credentials related.

    My register DLL script I made uses the Agent Credentials to run the "ExecuteShellCommand" step and you do this by adding the "useCredentials" step before you specify you "ExecuteShellCommand" step and then you configure the "ExecuteShellCommand" step to use "Execute as User"

    Another problem that many beginners run into is that they don't script for both 32bit and 64bit OS's. You can do this by adding the "If getOS" statement and having two "ExecuteShellCommand" steps configuring the 64bit one to use the 64bit "Run As" step option

    The other issue I can see is you are using regsvr32 /i instead of regsvr32 /s for silent installation. I would also recommend using the full path just for in case;


    You can also debug your command s by copying the exact command that you plan to execute and putting it in a "WriteProcedureLogEntry" this can help you find missing values or other Kaseya related formatting quirks. Note that Missing variable values written to the Procedure log will normally cause the line to display as blank in the Procedure Log.

  • FYI It looks like your JNLP file association is also missing a step;

    First you create the file type:

    ftype JNLPFile="C:\Program Files (x86)\Java\jre7\bin\javaws.exe" "%1"

    Then you associate the file type with the file extension:

    assoc .jnlp=JNLPFile