Menu

Custom Commands

2013-02-01
2013-04-24
  • Jeremy Shupick

    Jeremy Shupick - 2013-02-01

    Sometimes the LANDesk remote control service can be troublesome.
    Now a person can do remote computer manage and mess with the service (restart/stop/start) or just check it.
    I have added some custom commands to my remote control tools menu, and I wanted to share.
    There is nothing to install as this is part of the windows 7 install. (Only tested with Windows 7)

    <MenuItem xsi:type="MenuAction" Name="LANDesk Remote Service Stop">
      <Command>cmd.exe</Command>
      <Parameters>/K "SC.exe \\%"Computer"."Network"."TCPIP"."Host Name"% stop issuser"</Parameters>
      <OSType>Workstation, Server</OSType>
    </MenuItem>
    <MenuItem xsi:type="MenuAction" Name="LANDesk Remote Service Start">
      <Command>cmd.exe</Command>
      <Parameters>/K "SC.exe \\%"Computer"."Network"."TCPIP"."Host Name"% start issuser"</Parameters>
      <OSType>Workstation, Server</OSType>
    </MenuItem>
    <MenuItem xsi:type="MenuAction" Name="LANDesk Remote Service Query">
      <Command>cmd.exe</Command>
      <Parameters>/K "SC.exe \\%"Computer"."Network"."TCPIP"."Host Name"% query issuser"</Parameters>
      <OSType>Workstation, Server</OSType>
    </MenuItem>
    

    I can't get the above to format correctly if someone could help me format it. so the above does not have all the syntax.
    I tried the # in front and the ~ above and below.

    Thanks,

    Jeremy

     

    Last edit: Jared Barneck 2013-03-28
  • Jared Barneck

    Jared Barneck - 2013-03-27

    OK. Here is your problem. This is executing on the Console and trying to use a Windows Service to connect to the remote machine and stop the service.

    You should execute on the client as follows:

    <MenuItem xsi:type="MenuAction" Name="LANDesk Remote Service Stop">
      <Command>sc.exe</Command>
      <Parameters>stop issuser"</Parameters>
      <OSType>Workstation, Server</OSType>
      <ExecutionLocation>Client</ExecutionLocation>
    </MenuItem>
    

    Also, no need to wrap the command in cmd /k. You can just call sc.exe directly.

    I just tested this and it worked on Windows 7 64 bit.

     

    Last edit: Jared Barneck 2013-03-28
  • Jared Barneck

    Jared Barneck - 2013-03-28

    I am actually going to put this in. This is more generic and allows for starting or stopping any service (assuming you know the service name.

    <MenuItem xsi:type="MenuAction" Name="Start a Service">
      <Command>sc.exe</Command>
      <Parameters>stop %prompt:Enter the name of the service to start.:128%"</Parameters>
      <OSType>Workstation, Server</OSType>
      <ExecutionLocation>Client</ExecutionLocation>
    </MenuItem>
    <MenuItem xsi:type="MenuAction" Name="Stop a Service">
      <Command>sc.exe</Command>
      <Parameters>start %prompt:Enter the name of the service to stop.:128%"</Parameters>
      <OSType>Workstation, Server</OSType>
      <ExecutionLocation>Client</ExecutionLocation>
    </MenuItem>
    
     
  • Anonymous

    Anonymous - 2013-04-24
    Post awaiting moderation.

Anonymous
Anonymous

Add attachments
Cancel