First of all I found out I can have the LS tools on the network. So all of my programs start with \\server\share$\. This helps so I do not need to have them on my desktop, and if I needed to change/add anything, other people would not have to re-copy the folder.
Another custom action is this:
If Wscript.Arguments.Count = 0 Then
strComputer = "."
else
strComputer = Wscript.Arguments(0)
end if
strCommand = "notepad.exe"
Const INTERVAL = "n"
Const MINUTES = 1
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objScheduledJob = objWMIService.Get("Win32_ScheduledJob")
Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime")
objSWbemDateTime.SetVarDate(DateAdd(INTERVAL, MINUTES, Now()))
errReturn = objScheduledJob.Create(strCommand, objSWbemDateTime.Value, False, 0, 0, True, intJobID)
If errReturn = 0 Then
Wscript.Echo "Notepad was started with a process ID: " & intJobID
Else
Wscript.Echo "Notepad could not be started due to error: " & errReturn
End If
What this script does is runs an .exe from your computer to the target computer. Unlike psexec, this will actually run it interactive. The only thing is that it uses the Windows scheduled task so it can take up to 1 minute for it to kick off.
The point is, it can run autoit and .bat files that never seemed to run correctly for me. It can also run files from the network or local PC.
Lansweeper line is:
\\server\share\script.vbs {computer}
If you do not have an argument (i.e. double click) then it will run on the local computer. Change Notepad to whatever .exe you would like.
This script is not my own, I just modified it from
http://motevich.blogspot.com/2007/11/execute-program-on-remote-computer.html