Figured it out, in this case it was the exit 0 that was causing the problem.
It had to be either exit /B 0 or exit /B %ERRORLEVEL% works in this case too
I have exactly the same problem, and even with the EXIT /B 0 it return always an failed with error code 16386.
Is you bat running into the user context or system? Because I would like to run VBS into user context via a batch...
The script I was using was using the system context.
Is your .vbs script actually executing?
Yes the script is executing correctly, but I always have the error 16386
If I run the same batch in system context, I do not have this error 16386...
Why would you need it to run in user context out of curiosity?
No problem... I have a lot of application that need settings on the user part, like reg key into HKCU, INI file into the user profile, etc...
For example, we are use the Cisco IP phone, this software need to have one unique ID per user, and these settings are store into the reg kex HKCU.
How did you manage that in LANDesk??
The only way I found is to create a VBS that run into the user context. This VBS make change on the key HKCU. I create a scheduler task, with the main package is the MSI in the system context and then a final packages is my VBS in the user context.
It's not really perfect because, if a second user is login, the settings are not applied and also if no body is logged on, the final packages failed...
I looking for another way, but it's not really simple. (FYI: we are working for around 350 apps for 10'000 devices)
Any comment ;-)
I know, I know..
Login script, GPO, GPOP can be solution. But have you one idea to manage 350 * 5 * 80 settings into you logon script.
Because 350 apps * average 5 settings to manage * 80 sites/region because all region have different settings...
And of course everything should be delegate per ServiceDesk for changing settings?
Not sure that the login script is the solution (avoided to have 50 pages) and the same for GPO. I do not want to have tousand of GPO. The user login experience would be very bad...
I've never designed anything to that scale before, but I don't see how to do that with LANDesk if you need things to run in HKCU or on a per user basis.
Since you need the user to be logged in before you can run the package, how else are you going to ensure that everyone gets the correct settings they need?
Since we are getting on a tangent, these might be helpful..
There was another really good document that I can't find at the moment. It showed you how to send custom messages back to the server from a .bat to give you a better idea of what is going on. That other link might be more useful though
Couple other ways:
- runonce reg key
- wrap the application launching exe in a script that looks for and then writes the necessary settings wherever it needs to go and then replace the app shortcut with a shortcut to that one for first launch and then write back the original to the user's profile. Did this for an e-mail migration and worked like a charm.
- runonce reg key
Hi, Many thanks for your doc...
Have you try?? Because if you add the command line, the LANDesk wizard tell you that there is unavailable char in the command line.
LDMS v9 SP2 doesn't support > in the command line...
Funny no ;-)