Hi ppl,

SMS distributes the application (Dosprint) by running a VBScript which installs the MSI then attempts to do the following>

intDP = "C:\Windows\system32\dosprint"&chr(32)&"install"
excDP = "C:\Windows\system32\net"&chr(32)&"start"&chr(32)&"dosprint"
WshShell.run intDP,0,wait
WshShell.run excDP,0,wait

This runs OK as me, but when sent via sms it does not install then start the service. I have put messgae boxes in the script and they popup OK so it is running OK but it is not installing then starting the service.

Any ideas?

Barry
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
OK narrowed it down to be the
intDP = "C:\Windows\system32\dosprint"&chr(32)&"install"

for whatever reason it will not run the command "dosprint.exe install" yet when this is done manually then the job run though sms the net start works A OK.. why is it not running the install?
Answered 05/24/2006 by: BarryB
Orange Belt

Please log in to comment
1
Solved thanks to a couple of pointers from chaps on Google Groups :) Here is my solution:

Created a separate install in the DOS print package that only runs when
the users are logged in, it invokes a vb script that uses "run as" and
an AD account to install and start the service, as Mike pointed out it
appears to need to use Domain credentials. The new install is set with
a dependency on DOS print which is a separate package and installs the
EXE and directory structure required via an MSI.


Thanks again for all your help,


---------------------------------------------------------------------------­-------
On Error Resume Next
Suppresses Errors


Dim Shell, WshShell,FSO


set WshShell = CreateObject("WScript.Shell")


Wscript.Sleep 2000 'Sleeps to ensure MSI has completed
sUser="YOUR_AD\Service_Account"
sPass="Your_Password"&VbCrLf
sCmd="C:\Windows\System32\DOSPrint.exe install" 'Cmd line that installs DOS Print Service

tCmd="C:\Windows\System32\net start DOSPrint" 'Cmd line that starts service
set WshShell = CreateObject("WScript.Shell")
set WshEnv = WshShell.Environment("Process")
WinPath = WshEnv("SystemRoot")&"\System32\runas.exe"
set FSO = CreateObject("Scripting.FileSystemObject")


rc=WshShell.Run("runas /user:" & sUser & " " & CHR(34) & sCmd & CHR(34), 2, FALSE)
Wscript.Sleep 50 'need to give time for window to open.
WshShell.AppActivate(WinPath) 'make sure we grab the right window to
send password to
WshShell.SendKeys sPass 'send the password to the waiting window.
Wscript.Sleep 4000 'Gives service time to install properly
rc=WshShell.Run("runas /user:" & sUser & " " & CHR(34) & tCmd & CHR(34), 2, FALSE)
Wscript.Sleep 50 'need to give time for window to open.
WshShell.AppActivate(WinPath) 'make sure we grab the right window to send password to
WshShell.SendKeys sPass 'send the password to the waiting window.
Set WshShell=Nothing
set WshEnv=Nothing
set FSO=Nothing


wscript.quit
Answered 05/26/2006 by: BarryB
Orange Belt

Please log in to comment
Answer this question or Comment on this question for clarity