psexec und dosbatch
Verfasst: 28 Apr 2011, 14:41
Hallo,
ich stehe vor dem Problem, dass ich ein Programm verteilen muss bei dem ich die Setup.exe von einer Freigabe aus starte, auf die pcpatch keinen Zugriff hat. Daher kommt auch immer eine Passwortabfrage beim Zugriff darauf. Deshalb wollte ich das ganze jetzt mit psexec.exe in eine batch schreiben und als Administrator ausführen und dabei dass Passwort übergeben, jedoch startet die Installation jetzt garnicht.
Ich vermute das es am batch-Aufruf liegt.
ich stehe vor dem Problem, dass ich ein Programm verteilen muss bei dem ich die Setup.exe von einer Freigabe aus starte, auf die pcpatch keinen Zugriff hat. Daher kommt auch immer eine Passwortabfrage beim Zugriff darauf. Deshalb wollte ich das ganze jetzt mit psexec.exe in eine batch schreiben und als Administrator ausführen und dabei dass Passwort übergeben, jedoch startet die Installation jetzt garnicht.
Ich vermute das es am batch-Aufruf liegt.
Code: Alles auswählen
;Script zur Installation von Stahlschluessel_2010
;von E. Keller, 23.02.2011
[Initial]
; Message at install time:
Message=Installing Stahlschluessel_2010
LogLevel=2
; Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false
[Aktionen]
ShowBitmap /3 "%SCRIPTPATH%\Programm.png"
DefVar $TEMP$
Set $TEMP$ = EnvVar("TEMP")
;Variables for OS version
DefVar $OS$
set $OS$ = GetOS
; is this a win32 system ?
if ( $OS$ = "Windows_NT" )
if not(HasMinimumSpace ("%SYSTEMDRIVE%", "300 MB"))
LogError "Not enough space (<300MB) on %SYSTEMDRIVE%. "
else
; show product picture
;ShowBitmap /3 "%scriptpath%\Programm.png" "Stahlschluessel_2010"
; Start Setup-Program
Files_CopyFiles
Dosbatch_Stahlkey
winbatch_perms
endif
endif
[Files_CopyFiles]
copy %scriptpath%\xcacls.exe "C:\Windows\system32\"
copy %scriptpath%\PsExec.exe "C:\Windows\system32\"
[Dosbatch_Stahlkey]
psexec.exe
\\132.112.11.32\stahlkey\Stahlschluessel_2010_Server\Setup.exe /accepteula -u admin -p 123123 /S /DI=1 /DB=1 /SM=Stahlschluessel_2010 /L=0 /D=C:\Programme\Stahlschluessel_2010
[winbatch_perms]
%scriptpath%\perms.bat