diff --git a/ACVer AC4/ACVer AC4/GUI_ACVER.bat b/ACVer AC4/ACVer AC4/GUI_ACVER.bat
new file mode 100644
index 0000000..d29f132
--- /dev/null
+++ b/ACVer AC4/ACVer AC4/GUI_ACVER.bat
@@ -0,0 +1,36 @@
+@echo off
+cls
+echo **************************************************************
+echo **************************************************************
+echo **************************************************************
+echo ***** ********
+echo ***** ACVer setzen ********
+echo ***** ********
+echo ***** ********
+echo **************************************************************
+echo **************************************************************
+set /p Rechnername= Bitte Rechnernamen/Hostnamen eingeben:
+set /p ACVer= Bitte die ACVer eingeben:
+echo **************************************************************
+echo **************************************************************
+echo *****
+echo ***** Rechnername: %Rechnername%
+echo *****
+echo *****
+echo ***** ACVer: %ACVer%
+echo *****
+echo **************************************************************
+echo **************************************************************
+echo **************************************************************
+
+set /p verify=Alle Daten korrekt? (j/n):
+if "%verify%"=="n" (goto start)
+if "%verify%"=="j" (goto init)
+goto EOF
+
+:init
+copy "setacver_proc.bat" "\\%Rechnername%\c$\windows\system32\setacver_proc.bat"
+psexec \\%Rechnername% -s "setacver_proc.bat" %ACVer%
+
+:EOF
+pause
diff --git a/ACVer AC4/ACVer AC4/setacver_proc.bat b/ACVer AC4/ACVer AC4/setacver_proc.bat
new file mode 100644
index 0000000..febd1ad
--- /dev/null
+++ b/ACVer AC4/ACVer AC4/setacver_proc.bat
@@ -0,0 +1,33 @@
+@echo off
+
+echo ################################################################################
+echo #### Umgebungsvariable
+echo ################################################################################
+
+@echo on
+set ACVer=%1
+@echo off
+
+
+echo ################################################################################
+echo #### Altdaten loeschen
+echo ################################################################################
+
+REG DELETE "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v ACVer /f
+REG DELETE "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Session Manager\Environment" /v ACVer /f
+REG DELETE "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet\Control\Session Manager\Environment" /v ACVer /f
+
+
+echo ################################################################################
+echo #### ACVer in registry einfuegen
+echo ################################################################################
+
+
+REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v ACVer /d %ACVer% /f
+REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Session Manager\Environment" /v ACVer /d %ACVer% /f
+REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet\Control\Session Manager\Environment" /v ACVer /d %ACVer% /f
+
+
+echo ################################################################################
+echo #### Ende
+echo ################################################################################
\ No newline at end of file
diff --git a/CATChecker/CONF/basisinfo.xml b/CATChecker/CONF/basisinfo.xml
new file mode 100644
index 0000000..2cbc365
--- /dev/null
+++ b/CATChecker/CONF/basisinfo.xml
@@ -0,0 +1,10 @@
+
+
+
+ 5
+ 10
+ 10
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/besprechungszimmer.xml b/CATChecker/CONF/besprechungszimmer.xml
new file mode 100644
index 0000000..839b6b1
--- /dev/null
+++ b/CATChecker/CONF/besprechungszimmer.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/directory.xml b/CATChecker/CONF/directory.xml
new file mode 100644
index 0000000..365f506
--- /dev/null
+++ b/CATChecker/CONF/directory.xml
@@ -0,0 +1,15 @@
+
+
+
+ 90
+ 100
+ 100
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/directory_ac2_32_c.xml b/CATChecker/CONF/directory_ac2_32_c.xml
new file mode 100644
index 0000000..0104bbe
--- /dev/null
+++ b/CATChecker/CONF/directory_ac2_32_c.xml
@@ -0,0 +1,9 @@
+
+
+
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-32-O-IEX-SecConfig
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-32-O-ADM-BASIS
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-32-O-SEC-BASIS
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-32-O-SEC-DESKTOP
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/directory_ac2_32_l.xml b/CATChecker/CONF/directory_ac2_32_l.xml
new file mode 100644
index 0000000..49f4c6d
--- /dev/null
+++ b/CATChecker/CONF/directory_ac2_32_l.xml
@@ -0,0 +1,9 @@
+
+
+
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-32-O-IEX-SecConfig
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-32-O-ADM-BASIS
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-32-O-SEC-BASIS
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-32-O-SEC-NOTEBOOK
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/directory_ac2_64_c.xml b/CATChecker/CONF/directory_ac2_64_c.xml
new file mode 100644
index 0000000..d0f512a
--- /dev/null
+++ b/CATChecker/CONF/directory_ac2_64_c.xml
@@ -0,0 +1,9 @@
+
+
+
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-64-O-IEX-SecConfig
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-64-O-ADM-BASIS
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-64-O-SEC-BASIS
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-64-O-SEC-DESKTOP
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/directory_ac2_64_l.xml b/CATChecker/CONF/directory_ac2_64_l.xml
new file mode 100644
index 0000000..3f36a0e
--- /dev/null
+++ b/CATChecker/CONF/directory_ac2_64_l.xml
@@ -0,0 +1,9 @@
+
+
+
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-64-O-IEX-SecConfig
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-64-O-ADM-BASIS
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-64-O-SEC-BASIS
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC2-64-O-SEC-NOTEBOOK
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/directory_acb3_c.xml b/CATChecker/CONF/directory_acb3_c.xml
new file mode 100644
index 0000000..a3c24e7
--- /dev/null
+++ b/CATChecker/CONF/directory_acb3_c.xml
@@ -0,0 +1,8 @@
+
+
+
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC-B-O-IEX-SecConfig
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC-B-O-SEC-BASIS
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC-B-O-SEC-DESKTOP
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/directory_acb3_l.xml b/CATChecker/CONF/directory_acb3_l.xml
new file mode 100644
index 0000000..b9ac42e
--- /dev/null
+++ b/CATChecker/CONF/directory_acb3_l.xml
@@ -0,0 +1,8 @@
+
+
+
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC-B-O-IEX-SecConfig
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC-B-O-SEC-BASIS
+ G-AUDI-AG-GPOFLT-C-AUDI-CAT-AC-B-O-SEC-NOTEBOOK
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/environment.xml b/CATChecker/CONF/environment.xml
new file mode 100644
index 0000000..2adf733
--- /dev/null
+++ b/CATChecker/CONF/environment.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/eventlog.xml b/CATChecker/CONF/eventlog.xml
new file mode 100644
index 0000000..be70f62
--- /dev/null
+++ b/CATChecker/CONF/eventlog.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/exec.xml b/CATChecker/CONF/exec.xml
new file mode 100644
index 0000000..090d645
--- /dev/null
+++ b/CATChecker/CONF/exec.xml
@@ -0,0 +1,165 @@
+
+
+
+ Computerverwaltung
+ Computerverwaltung
+
+
+
+ 1
+ 0
+
+
+ Remotecontroll
+ Remotecontroll (SCCM)
+
+
+
+ 1
+ 0
+
+
+ Remotedesktop (RDP)
+ Remotedesktop (RDP)
+
+
+
+ 1
+ 0
+
+
+
+ Regedit
+
+
+
+ 1
+ 0
+
+
+ DCOM
+ Repair Tool
+
+
+
+ 1
+ 0
+
+
+ WMI
+ Repair Tool
+
+
+
+ 1
+ 0
+
+
+ SCCM Deinstallation
+ Repair Tool
+
+
+
+ 1
+ 0
+
+
+ SCCM (Re)Installation
+ Repair Tool
+
+
+
+ 1
+ 0
+
+
+ CAT-Wiki
+
+
+
+
+ 2
+ 0
+
+
+ SMS-Reporting
+
+
+
+
+ 2
+ 0
+
+
+ CAT-Auftrag
+
+
+
+
+ 2
+ 0
+
+
+ EEPCwebHelpDesk
+
+
+
+
+ 2
+ 0
+
+
+ DNSweb
+
+
+
+
+ 2
+ 0
+
+
+ ping
+ ping
+
+
+
+ 1
+ 0
+
+
+ ARS
+ ARS
+
+
+
+ 1
+ 0
+
+
+ RC-ReEnable
+ RC-ReEnable
+
+
+
+ 1
+ 0
+
+
+ Explorer++
+ Explorer++
+
+
+
+ 1
+ 0
+
+
+ OffCAT
+ OffCAT
+
+
+
+ 1
+ 0
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/mcafee.xml b/CATChecker/CONF/mcafee.xml
new file mode 100644
index 0000000..656e8e5
--- /dev/null
+++ b/CATChecker/CONF/mcafee.xml
@@ -0,0 +1,16 @@
+
+
+
+ 8.8
+ 8.7
+
+
+ 8.0
+ 7.0
+
+
+ 4.6
+ 4.5
+
+ 2
+
\ No newline at end of file
diff --git a/CATChecker/CONF/sccm.xml b/CATChecker/CONF/sccm.xml
new file mode 100644
index 0000000..5954a42
--- /dev/null
+++ b/CATChecker/CONF/sccm.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/services.xml b/CATChecker/CONF/services.xml
new file mode 100644
index 0000000..7b959b7
--- /dev/null
+++ b/CATChecker/CONF/services.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/services_ac2_32_c.xml b/CATChecker/CONF/services_ac2_32_c.xml
new file mode 100644
index 0000000..b0e1097
--- /dev/null
+++ b/CATChecker/CONF/services_ac2_32_c.xml
@@ -0,0 +1,182 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/services_ac2_32_l.xml b/CATChecker/CONF/services_ac2_32_l.xml
new file mode 100644
index 0000000..c4b2f30
--- /dev/null
+++ b/CATChecker/CONF/services_ac2_32_l.xml
@@ -0,0 +1,182 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/services_ac2_64_c.xml b/CATChecker/CONF/services_ac2_64_c.xml
new file mode 100644
index 0000000..09fc5e1
--- /dev/null
+++ b/CATChecker/CONF/services_ac2_64_c.xml
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/services_ac2_64_l.xml b/CATChecker/CONF/services_ac2_64_l.xml
new file mode 100644
index 0000000..0787078
--- /dev/null
+++ b/CATChecker/CONF/services_ac2_64_l.xml
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/services_acb3_c.xml b/CATChecker/CONF/services_acb3_c.xml
new file mode 100644
index 0000000..37fb054
--- /dev/null
+++ b/CATChecker/CONF/services_acb3_c.xml
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/services_acb3_l.xml b/CATChecker/CONF/services_acb3_l.xml
new file mode 100644
index 0000000..d341ffd
--- /dev/null
+++ b/CATChecker/CONF/services_acb3_l.xml
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/tests.xml b/CATChecker/CONF/tests.xml
new file mode 100644
index 0000000..b46cd91
--- /dev/null
+++ b/CATChecker/CONF/tests.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CATChecker/CONF/ui.xml b/CATChecker/CONF/ui.xml
new file mode 100644
index 0000000..5fb5e0f
--- /dev/null
+++ b/CATChecker/CONF/ui.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+ Basisinfo
+ true
+
+
+
+
+ Services
+ true
+
+
+
+
+ Directory
+ true
+
+
+
+
+ Sccm
+ true
+
+
+
+
+ Eventlog
+ true
+
+
+
+
+ Mcafee
+ true
+
+
+
+
+ Besprechungszimmer
+ true
+
+
+
+
+ Environment
+ true
+
+
+
\ No newline at end of file
diff --git a/CATChecker/Cat Checker.lnk b/CATChecker/Cat Checker.lnk
new file mode 100644
index 0000000..2f393bb
Binary files /dev/null and b/CATChecker/Cat Checker.lnk differ
diff --git a/CATChecker/Checker.exe b/CATChecker/Checker.exe
new file mode 100644
index 0000000..2515e11
Binary files /dev/null and b/CATChecker/Checker.exe differ
diff --git a/CATChecker/DLLs/CAT_Checker.exe b/CATChecker/DLLs/CAT_Checker.exe
new file mode 100644
index 0000000..0021709
Binary files /dev/null and b/CATChecker/DLLs/CAT_Checker.exe differ
diff --git a/CATChecker/DLLs/CAT_Checker.pdb b/CATChecker/DLLs/CAT_Checker.pdb
new file mode 100644
index 0000000..7045968
Binary files /dev/null and b/CATChecker/DLLs/CAT_Checker.pdb differ
diff --git a/CATChecker/DLLs/CAT_Checker.vshost.exe b/CATChecker/DLLs/CAT_Checker.vshost.exe
new file mode 100644
index 0000000..8c84517
Binary files /dev/null and b/CATChecker/DLLs/CAT_Checker.vshost.exe differ
diff --git a/CATChecker/DLLs/CAT_Checker_TestProzessor.exe b/CATChecker/DLLs/CAT_Checker_TestProzessor.exe
new file mode 100644
index 0000000..6191604
Binary files /dev/null and b/CATChecker/DLLs/CAT_Checker_TestProzessor.exe differ
diff --git a/CATChecker/DLLs/CAT_Checker_TestProzessor.pdb b/CATChecker/DLLs/CAT_Checker_TestProzessor.pdb
new file mode 100644
index 0000000..27dc4ac
Binary files /dev/null and b/CATChecker/DLLs/CAT_Checker_TestProzessor.pdb differ
diff --git a/CATChecker/DLLs/CAT_Checker_TestProzessor.vshost.exe b/CATChecker/DLLs/CAT_Checker_TestProzessor.vshost.exe
new file mode 100644
index 0000000..8c84517
Binary files /dev/null and b/CATChecker/DLLs/CAT_Checker_TestProzessor.vshost.exe differ
diff --git a/CATChecker/DLLs/Microsoft.VisualBasic.PowerPacks.Vs.dll b/CATChecker/DLLs/Microsoft.VisualBasic.PowerPacks.Vs.dll
new file mode 100644
index 0000000..fad00de
Binary files /dev/null and b/CATChecker/DLLs/Microsoft.VisualBasic.PowerPacks.Vs.dll differ
diff --git a/CATChecker/DLLs/basisinfo.dll b/CATChecker/DLLs/basisinfo.dll
new file mode 100644
index 0000000..bac5f89
Binary files /dev/null and b/CATChecker/DLLs/basisinfo.dll differ
diff --git a/CATChecker/DLLs/basisinfo.pdb b/CATChecker/DLLs/basisinfo.pdb
new file mode 100644
index 0000000..d71fb09
Binary files /dev/null and b/CATChecker/DLLs/basisinfo.pdb differ
diff --git a/CATChecker/DLLs/besprechungszimmer.dll b/CATChecker/DLLs/besprechungszimmer.dll
new file mode 100644
index 0000000..b472105
Binary files /dev/null and b/CATChecker/DLLs/besprechungszimmer.dll differ
diff --git a/CATChecker/DLLs/besprechungszimmer.pdb b/CATChecker/DLLs/besprechungszimmer.pdb
new file mode 100644
index 0000000..e5f5a92
Binary files /dev/null and b/CATChecker/DLLs/besprechungszimmer.pdb differ
diff --git a/CATChecker/DLLs/cclib.dll b/CATChecker/DLLs/cclib.dll
new file mode 100644
index 0000000..63c9daf
Binary files /dev/null and b/CATChecker/DLLs/cclib.dll differ
diff --git a/CATChecker/DLLs/cclib_old.dll b/CATChecker/DLLs/cclib_old.dll
new file mode 100644
index 0000000..fd89c39
Binary files /dev/null and b/CATChecker/DLLs/cclib_old.dll differ
diff --git a/CATChecker/DLLs/cclib_plugin.dll b/CATChecker/DLLs/cclib_plugin.dll
new file mode 100644
index 0000000..bd4aa06
Binary files /dev/null and b/CATChecker/DLLs/cclib_plugin.dll differ
diff --git a/CATChecker/DLLs/cclib_services.dll b/CATChecker/DLLs/cclib_services.dll
new file mode 100644
index 0000000..972e069
Binary files /dev/null and b/CATChecker/DLLs/cclib_services.dll differ
diff --git a/CATChecker/DLLs/cclib_tests.dll b/CATChecker/DLLs/cclib_tests.dll
new file mode 100644
index 0000000..fe8bd23
Binary files /dev/null and b/CATChecker/DLLs/cclib_tests.dll differ
diff --git a/CATChecker/DLLs/cclib_tt.dll b/CATChecker/DLLs/cclib_tt.dll
new file mode 100644
index 0000000..4eca0bf
Binary files /dev/null and b/CATChecker/DLLs/cclib_tt.dll differ
diff --git a/CATChecker/DLLs/directory.dll b/CATChecker/DLLs/directory.dll
new file mode 100644
index 0000000..7614c87
Binary files /dev/null and b/CATChecker/DLLs/directory.dll differ
diff --git a/CATChecker/DLLs/directory.pdb b/CATChecker/DLLs/directory.pdb
new file mode 100644
index 0000000..5fa3f08
Binary files /dev/null and b/CATChecker/DLLs/directory.pdb differ
diff --git a/CATChecker/DLLs/environment.dll b/CATChecker/DLLs/environment.dll
new file mode 100644
index 0000000..f81bd36
Binary files /dev/null and b/CATChecker/DLLs/environment.dll differ
diff --git a/CATChecker/DLLs/environment.pdb b/CATChecker/DLLs/environment.pdb
new file mode 100644
index 0000000..e6562b3
Binary files /dev/null and b/CATChecker/DLLs/environment.pdb differ
diff --git a/CATChecker/DLLs/eventlog.dll b/CATChecker/DLLs/eventlog.dll
new file mode 100644
index 0000000..cf315f4
Binary files /dev/null and b/CATChecker/DLLs/eventlog.dll differ
diff --git a/CATChecker/DLLs/eventlog.pdb b/CATChecker/DLLs/eventlog.pdb
new file mode 100644
index 0000000..3f6685f
Binary files /dev/null and b/CATChecker/DLLs/eventlog.pdb differ
diff --git a/CATChecker/DLLs/mcafee.dll b/CATChecker/DLLs/mcafee.dll
new file mode 100644
index 0000000..7e0b4e6
Binary files /dev/null and b/CATChecker/DLLs/mcafee.dll differ
diff --git a/CATChecker/DLLs/mcafee.pdb b/CATChecker/DLLs/mcafee.pdb
new file mode 100644
index 0000000..ecb0f52
Binary files /dev/null and b/CATChecker/DLLs/mcafee.pdb differ
diff --git a/CATChecker/DLLs/msvcr71.dll b/CATChecker/DLLs/msvcr71.dll
new file mode 100644
index 0000000..b50a30d
Binary files /dev/null and b/CATChecker/DLLs/msvcr71.dll differ
diff --git a/CATChecker/DLLs/sccm.dll b/CATChecker/DLLs/sccm.dll
new file mode 100644
index 0000000..f896565
Binary files /dev/null and b/CATChecker/DLLs/sccm.dll differ
diff --git a/CATChecker/DLLs/sccm.pdb b/CATChecker/DLLs/sccm.pdb
new file mode 100644
index 0000000..f555abe
Binary files /dev/null and b/CATChecker/DLLs/sccm.pdb differ
diff --git a/CATChecker/DLLs/services.dll b/CATChecker/DLLs/services.dll
new file mode 100644
index 0000000..7feff6f
Binary files /dev/null and b/CATChecker/DLLs/services.dll differ
diff --git a/CATChecker/DLLs/services.pdb b/CATChecker/DLLs/services.pdb
new file mode 100644
index 0000000..215c380
Binary files /dev/null and b/CATChecker/DLLs/services.pdb differ
diff --git a/CATChecker/Start.bat b/CATChecker/Start.bat
new file mode 100644
index 0000000..9f3100f
--- /dev/null
+++ b/CATChecker/Start.bat
@@ -0,0 +1,3 @@
+cd /d %~dp0
+set VERZ=%CD%
+runas /savecred /user:a5gaser-adm@audi.de "%VERZ%\checker.exe"
\ No newline at end of file
diff --git a/CMD/#ForceReboot/#ForceReboot/forceReboot_remote.bat b/CMD/#ForceReboot/#ForceReboot/forceReboot_remote.bat
new file mode 100644
index 0000000..5fe33f7
--- /dev/null
+++ b/CMD/#ForceReboot/#ForceReboot/forceReboot_remote.bat
@@ -0,0 +1,18 @@
+rem activate scheduled task for scheduled reboot on each client specified in clients_to_copy_scheduledReboot.txt
+rem 1 clientname per line
+
+Echo Soll der Reboot auf den CLients ausgeführt werden?
+SET /P X=(J)a oder (N)ein?
+IF /I "%X%"=="J" goto :JA
+goto ENDE
+
+:JA
+for /F "tokens=*" %%C in (clients_to_copy.txt) do (
+ psshutdown \\%%C -r -f -t 10
+
+ if errorlevel 1 echo %%C >> clients.txt
+
+)
+
+:ENDE
+pause
\ No newline at end of file
diff --git a/CMD/#ForceReboot/#ForceReboot/psexec.exe b/CMD/#ForceReboot/#ForceReboot/psexec.exe
new file mode 100644
index 0000000..5810762
Binary files /dev/null and b/CMD/#ForceReboot/#ForceReboot/psexec.exe differ
diff --git a/CMD/#ForceReboot/#ForceReboot/psshutdown.exe b/CMD/#ForceReboot/#ForceReboot/psshutdown.exe
new file mode 100644
index 0000000..8106ceb
Binary files /dev/null and b/CMD/#ForceReboot/#ForceReboot/psshutdown.exe differ
diff --git a/CMD/Aktivierung/GUI_Activator.bat b/CMD/Aktivierung/GUI_Activator.bat
new file mode 100644
index 0000000..c099645
--- /dev/null
+++ b/CMD/Aktivierung/GUI_Activator.bat
@@ -0,0 +1,168 @@
+@echo off
+::
+::
+:start
+cls
+set VERZ=%~dp0
+color 0f
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo -* *-
+echo -* User:%USERNAME% *-
+echo ** **
+echo ** **
+echo ** **
+echo ** **
+echo ** **
+echo ** **
+echo ** **
+echo ** **
+echo ** - Aktivierungstool - **
+echo ** ==================== **
+echo *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+echo ** **
+echo * - M-E-N-U-E - *
+echo ** ______________ **
+echo ** **
+echo ** 1.)= Office 2016 **
+echo ** ----------------- **
+echo ** 2.)= WINDOWS 10 CLIENT **
+echo ** --------------------- **
+echo ** 3.)= LYNC ACTIVATOR **
+echo ** --------------------- **
+echo ** 4.)= WINDOWS CLIENT -KMS FIX **
+echo ** --------------------- **
+echo ** 5.)= Office 2013 **
+echo ** --------------------- **
+echo ** 0.)= Neue Eingabe **
+echo ** _____________ **
+echo ***-----------------------------------------------------------***
+echo * *
+echo * *
+echo * *
+echo *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+echo.
+set /p Rechnername= Bitte CLIENT-ID / Hostnamen eingeben :
+
+::Prfen, ob Rechner anpingbar ist.
+ping %Rechnername% -n 1
+
+IF NOT %ERRORLEVEL%==0 echo ***** ACHTUNG: Rechner konnte nicht angepingt werden
+IF NOT %ERRORLEVEL%==0 set ERRORLEVEL=2 & goto eof
+
+
+
+set Site=%Rechnername:~4,2%
+echo NE O IN %Site%
+
+set /p Reparatur=Bitte waehlen Sie eine Option aus:
+echo ==============================================
+if "%Reparatur%"=="1" set RepInfo="Office 2010"
+if "%Reparatur%"=="2" set RepInfo="Windows 10"
+if "%Reparatur%"=="3" set RepInfo="Lync Activator"
+if "%Reparatur%"=="4" set RepInfo="KMS-Reperatur activator"
+if "%Reparatur%"=="5" set RepInfo="Office 2013"
+if "%Reparatur%"=="0" set RepInfo="neue Eingabe"
+
+set geraeteTyp=%Rechnername:~6,1%
+
+
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo ** **
+echo ** Rechnername: %Rechnername% **
+echo ** **
+echo ** Geraetetyp: %geraeteTyp% **
+echo ** (C= Client) **
+echo ** (L= Laptop) **
+echo ** **
+echo ** Betriebsystem: Windows -%bitVersion%bit **
+echo ** **
+echo ** Auswahl war:%RepInfo% **
+echo ** **
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo.
+
+goto init
+
+goto eof
+
+:init
+
+if "%Reparatur%"=="1" goto activateOffice
+if "%Reparatur%"=="2" goto activateWindows
+if "%Reparatur%"=="3" goto activateLYNC
+if "%Reparatur%"=="4" goto repwinkms
+if "%Reparatur%"=="5" goto activateOffice13
+
+goto eof
+
+:activateOffice
+echo *******************************************************************************
+echo ***** Office-Aktivierung ********
+echo *******************************************************************************
+echo ***** ...Bitte warten, Aktivierung wird durchgefhrt.... ********
+echo *******************************************************************************
+echo %VERZ%int_proc_OFF2010_%Site%.bat
+copy "%VERZ%int_proc_OFF2010_%Site%.bat" "\\%Rechnername%\c$\temp\int_proc_OFF2010_%Site%.bat"
+psexec \\%Rechnername% -s "c:\temp\int_proc_OFF2010_%Site%.bat" -f
+del "\\%Rechnername%\c$\temp\int_proc_OFF2010_%Site%.bat"
+goto eof
+
+
+:activateOffice13
+echo *******************************************************************************
+echo ***** Office-Aktivierung ********
+echo *******************************************************************************
+echo ***** ...Bitte warten, Aktivierung wird durchgefhrt.... ********
+echo *******************************************************************************
+echo "%VERZ%int_proc_OFF2013_%Site%.bat"
+echo SITE = %Site%
+copy "%VERZ%int_proc_OFF2013_%Site%.bat" "\\%Rechnername%\c$\temp\int_proc_OFF2013_%Site%.bat"
+psexec \\%Rechnername% -s "c:\temp\int_proc_OFF2013_%Site%.bat" -f
+del "\\%Rechnername%\c$\temp\int_proc_OFF2013_%Site%.bat"
+goto eof
+
+:activateWindows
+echo *******************************************************************************
+echo ***** Windows-Aktivierung ********
+echo *******************************************************************************
+echo ***** ...Bitte warten, Aktivierung wird durchgefhrt.... ********
+echo *******************************************************************************
+echo.
+copy "%VERZ%int_proc_KMS_%Site%.bat" "\\%Rechnername%\c$\temp\int_proc_KMS_%Site%.bat"
+
+psexec \\%Rechnername% -s "c:\temp\int_proc_KMS_%Site%.bat" -f
+del "\\%Rechnername%\c$\temp\int_proc_KMS_%Site%.bat"
+psexec -s \\%Rechnername% cscript c:\windows\system32\slmgr.vbs /dli
+goto eof
+
+:activateLYNC
+echo ******************************************************************
+echo ** MS-LYNC wird aktivier fuer alle Benutzer **
+echo ******************************************************************
+copy "%VERZ%SYSTEM ENABLE LYNCADDON.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM ENABLE LYNCADDON.bat"
+
+psexec \\%Rechnername% -s "SYSTEM ENABLE LYNCADDON.bat" -f
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM ENABLE LYNCADDON.bat"
+goto eof
+
+
+:repwinkms
+echo ******************************************************************
+echo ** step 1 Win Sys.-rep. SFC **
+echo ******************************************************************
+copy "%VERZ%SYSTEM SFC.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM SFC.bat"
+psexec \\%Rechnername% -s "SYSTEM SFC.bat" -f
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM SFC.bat"
+goto eof
+
+:eof
+if "%errorlevel%"=="0" color 02 & goto farbegesetzt
+if "%errorlevel%"=="1" (color 02) else (color 0c)
+:farbegesetzt
+
+echo ****************************************************************************
+echo ***** AKTIVIERUNG Abgeschlossen - Error Code beachten! ***
+echo ****************************************************************************
+pause
+cls
+goto start
\ No newline at end of file
diff --git a/CMD/Aktivierung/Lyncaddon.bat b/CMD/Aktivierung/Lyncaddon.bat
new file mode 100644
index 0000000..2ae928e
--- /dev/null
+++ b/CMD/Aktivierung/Lyncaddon.bat
@@ -0,0 +1,122 @@
+@echo off
+::
+:start
+cls
+set Arbeitsverzeichnis=%1"
+set Arbeitsverzeichnis=%Arbeitsverzeichnis:"=%
+color 0f
+echo ************************************************
+echo **************************************************
+echo **** ****
+echo ** **
+echo ** **
+echo *** -= Aktivierungstool- TOOL =- ***
+echo **** Office / Windows Client ****
+echo *************************************************
+echo ********************************************************************
+echo *** -= M-E-N-U-E =- ******
+echo ***********************************=========*********************************
+echo ***** ********
+echo ***** Aktivierungstool: ********
+echo ***** ********
+echo ***** 1.)= Office ********
+echo ***** 2.)= Windows Client - KMS ********
+echo ***** 3.)= Windows Client fix ********
+echo *******************************************************************************
+echo *******************************************************************************
+echo *******************************************************************************
+echo *****************************************************************************
+set /p Rechnername= Bitte CLIENT-ID / Hostnamen eingeben :
+::Prfen, ob Rechner anpingbar ist.
+ping %Rechnername% -n 1
+sleep 1
+IF NOT %ERRORLEVEL%==0 echo ***** ACHTUNG: Rechner konnte nicht angepingt werden
+IF NOT %ERRORLEVEL%==0 set ERRORLEVEL=2 & goto EOF
+
+
+
+set Site=%Rechnername:~4,2%
+
+set /p Reparatur=Bitte waehlen Sie eine Option aus:
+echo ==============================================
+if "%Reparatur%"=="1" set RepInfo="Office 2010"
+if "%Reparatur%"=="2" set RepInfo="Windows 7"
+
+echo *****************************************************************************
+echo *******************************************************************************
+echo ***** ****
+echo ***** Rechnername: %Rechnername% ****
+echo ***** ****
+echo *******************************************************************************
+echo ***** Site: %Site% ****
+echo *******************************************************************************
+echo ***** ****
+echo ***** Option: %RepInfo% ****
+echo ***** ****
+echo *******************************************************************************
+echo *****************************************************************************
+
+set /p verify=Hostname, Site und Option korrekt? (j/n):
+echo *******************************************************************************
+if "%verify%"=="n" (goto start)
+if "%verify%"=="j" (goto init)
+goto eof
+
+:init
+if "%Reparatur%"=="1" goto activateOffice
+if "%Reparatur%"=="2" goto activateWindows
+goto eof
+
+:activateOffice
+echo *******************************************************************************
+echo ***** Office-Aktivierung ********
+echo *******************************************************************************
+echo ***** ...Bitte warten, Aktivierung wird durchgefhrt.... ********
+echo *******************************************************************************
+
+copy "%Arbeitsverzeichnis%int_proc_OFF2010_%Site%.bat" "\\%Rechnername%\c$\windows\system32\int_proc_OFF2010_%Site%.bat"
+psexec \\%Rechnername% -s "int_proc_OFF2010_%Site%.bat" -f
+del "\\%Rechnername%\c$\Windows\System32\int_proc_OFF2010_%Site%.bat"
+goto eof
+
+:activateWindows
+echo *******************************************************************************
+echo ***** Windows-Aktivierung ********
+echo *******************************************************************************
+echo ***** ...Bitte warten, Aktivierung wird durchgefhrt.... ********
+echo *******************************************************************************
+
+copy "%Arbeitsverzeichnis%int_proc_KMS_%Site%.bat" "\\%Rechnername%\c$\windows\system32\int_proc_KMS_%Site%.bat"
+@echo off
+psexec \\%Rechnername% -s "int_proc_KMS_%Site%.bat" -f
+del "\\%Rechnername%\c$\Windows\System32\int_proc_KMS_%Site%.bat"
+psexec -s \\%Rechnername% cscript c:\windows\system32\slmgr.vbs /dli
+
+:repwinkms
+echo ***** step 1 Win Sys.-rep. SFC ********
+echo ********************************************************************
+copy "%Arbeitsverzeichnis%SYSTEM SFC.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM SFC.bat"
+psexec \\%Rechnername% -s "SYSTEM SFC.bat" -f
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM SFC.bat"
+
+goto eof
+
+:eof
+if "%errorlevel%"=="0" color 02 & goto farbegesetzt
+if "%errorlevel%"=="1" (color 02) else (color 0c)
+:farbegesetzt
+
+echo *******************************************************************************
+echo ***** AKTIVIERUNG Abgeschlossen - Error Code beachten
+echo ???????????????
+echo ???????????????
+echo ???????????????
+echo ???????????????
+echo ???????????????
+echo ???????????????
+echo ??????????????? ********
+echo *******************************************************************************
+
+pause
+cls
+goto start
\ No newline at end of file
diff --git a/CMD/Aktivierung/SYSTEM ENABLE LYNCADDON.bat b/CMD/Aktivierung/SYSTEM ENABLE LYNCADDON.bat
new file mode 100644
index 0000000..3f35497
--- /dev/null
+++ b/CMD/Aktivierung/SYSTEM ENABLE LYNCADDON.bat
@@ -0,0 +1,42 @@
+@echo off
+::
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Lync Addon konfigurieren ********
+echo *******************************************************************************
+echo *******************************************************************************
+
+::User-spezifische Eintrge lschen
+@setlocal
+
+set "RegPath=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList"
+set "SID="
+
+for /f "delims=" %%i in ('reg query "%RegPath%"^|findstr /ibc:"%RegPath%\S-"') do (
+ echo %%~nxi & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{31D09BA0-12F5-4CCE-BE8A-2923E76605DA}" /f & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{761497BB-D6F0-462C-B6EB-D4DAF1D92D43}" /f & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{08B0E5C0-4FCB-11CF-AAA5-00401C608501}" /f
+)
+)
+sleep 1
+
+echo ******** Systemreg fuer Addon hinzufuegen
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {31D09BA0-12F5-4CCE-BE8A-2923E76605DA} /d 1 /f
+
+::REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{31D09BA0-12F5-4CCE-BE8A-2923E76605DA}" /f
+
+
+::InternetExplorer ffnen und schlieen
+echo ******** iexplore oeffnen
+start iexplore
+
+sleep 7
+
+echo ******** iexplorer schliessen
+Taskkill /F /IM iexplorer.exe /T 2>NUL
+echo ******** iexplore schliessen
+Taskkill /F /IM iexplore.exe /T 2>NUL
+
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Lync Addon konfiguration abgeschlossen ********
+echo *******************************************************************************
+echo *******************************************************************************
diff --git a/CMD/Aktivierung/int_proc_KMS_IN.bat b/CMD/Aktivierung/int_proc_KMS_IN.bat
new file mode 100644
index 0000000..2132137
--- /dev/null
+++ b/CMD/Aktivierung/int_proc_KMS_IN.bat
@@ -0,0 +1,6 @@
+
+::
+cscript //b slmgr.vbs /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43
+cscript //b slmgr.vbs -skms AUDIINSA1755.in.audi.vwg
+cscript //b slmgr.vbs -ato
+cscript //b slmgr.vbs -dli
\ No newline at end of file
diff --git a/CMD/Aktivierung/int_proc_KMS_NE.bat b/CMD/Aktivierung/int_proc_KMS_NE.bat
new file mode 100644
index 0000000..e508625
--- /dev/null
+++ b/CMD/Aktivierung/int_proc_KMS_NE.bat
@@ -0,0 +1,6 @@
+
+::
+cscript //b slmgr.vbs /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43
+cscript //b slmgr.vbs -skms audinesa0404.ne.audi.vwg
+cscript //b slmgr.vbs -ato
+cscript //b slmgr.vbs -dli
\ No newline at end of file
diff --git a/CMD/Aktivierung/int_proc_OFF2010_IN.bat b/CMD/Aktivierung/int_proc_OFF2010_IN.bat
new file mode 100644
index 0000000..532da4b
--- /dev/null
+++ b/CMD/Aktivierung/int_proc_OFF2010_IN.bat
@@ -0,0 +1,5 @@
+
+::
+cscript "%Program_Files%\Microsoft Office\Office16\ospp.vbs" /inpkey:XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99
+cscript "%Program_Files%\Microsoft Office\Office16\ospp.vbs" /sethst:audiinsa1755.in.audi.vwg
+cscript "%Program_Files%\Microsoft Office\Office16\ospp.vbs" /act
diff --git a/CMD/Aktivierung/int_proc_OFF2010_NE.bat b/CMD/Aktivierung/int_proc_OFF2010_NE.bat
new file mode 100644
index 0000000..07cd374
--- /dev/null
+++ b/CMD/Aktivierung/int_proc_OFF2010_NE.bat
@@ -0,0 +1,5 @@
+
+::
+cscript "%Program_Files%\Microsoft Office\Office14\ospp.vbs" /inpkey:XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99
+cscript "%Program_Files%\Microsoft Office\Office14\ospp.vbs" /sethst:audinesa0404.ne.audi.vwg
+cscript "%Program_Files%\Microsoft Office\Office14\ospp.vbs" /act
diff --git a/CMD/Aktivierung/int_proc_OFF2013_IN.bat b/CMD/Aktivierung/int_proc_OFF2013_IN.bat
new file mode 100644
index 0000000..83fef8c
--- /dev/null
+++ b/CMD/Aktivierung/int_proc_OFF2013_IN.bat
@@ -0,0 +1,5 @@
+
+::
+cscript "%Program_Files%\Microsoft Office\Office15\ospp.vbs" /inpkey:YC7DK-G2NP3-2QQC3-J6H88-GVGXT
+cscript "%Program_Files%\Microsoft Office\Office15\ospp.vbs" /sethst:audiinsa1755.in.audi.vwg
+cscript "%Program_Files%\Microsoft Office\Office15\ospp.vbs" /act
diff --git a/CMD/Aktivierung/int_proc_OFF2013_NE.bat b/CMD/Aktivierung/int_proc_OFF2013_NE.bat
new file mode 100644
index 0000000..2d4acaf
--- /dev/null
+++ b/CMD/Aktivierung/int_proc_OFF2013_NE.bat
@@ -0,0 +1,5 @@
+
+::
+cscript "%Program_Files%\Microsoft Office\Office15\ospp.vbs" /inpkey:YC7DK-G2NP3-2QQC3-J6H88-GVGXT
+cscript "%Program_Files%\Microsoft Office\Office15\ospp.vbs" /sethst:audinesa0404.ne.audi.vwg
+cscript "%Program_Files%\Microsoft Office\Office15\ospp.vbs" /act
diff --git a/CMD/Aktivierung/produkey/ProduKey.chm b/CMD/Aktivierung/produkey/ProduKey.chm
new file mode 100644
index 0000000..9c4ea32
Binary files /dev/null and b/CMD/Aktivierung/produkey/ProduKey.chm differ
diff --git a/CMD/FUP_FIX/Install_GUI.cmd b/CMD/FUP_FIX/Install_GUI.cmd
new file mode 100644
index 0000000..8b5bb21
--- /dev/null
+++ b/CMD/FUP_FIX/Install_GUI.cmd
@@ -0,0 +1,73 @@
+@echo off
+::
+::
+:start
+cls
+set VERZ=%~dp0
+color 0f
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo -* *-
+echo -* User:%USERNAME% *-
+echo ** **
+echo ** **
+echo ** - FUP Fix - **
+echo ** ==================== **
+echo *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+echo ** **
+echo ***-----------------------------------------------------------***
+echo * *
+echo * *
+echo * *
+echo *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+echo.
+set /p Rechnername= Bitte CLIENT-ID / Hostnamen eingeben :
+
+::Prfen, ob Rechner anpingbar ist.
+ping %Rechnername% -n 1
+::sleep 1
+IF NOT %ERRORLEVEL%==0 echo ***** ACHTUNG: Rechner konnte nicht angepingt werden
+IF NOT %ERRORLEVEL%==0 set ERRORLEVEL=2 & goto eof
+
+
+
+echo ==============================================
+
+
+
+set geraeteTyp=%Rechnername:~6,1%
+
+
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo ** **
+echo ** Rechnername: %Rechnername% **
+echo ** Betriebsystem: Windows -%bitVersion%bit **
+echo ** **
+echo ** Auswahl war:%RepInfo% **
+echo ** **
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo.
+
+
+
+echo *******************************************************************************
+echo *******************************************************************************
+echo ***** ...Bitte warten, aktion wird durchgefhrt.... ********
+echo *******************************************************************************
+copy "%VERZ%WinFupRep.bat" "\\%Rechnername%\c$\windows\system32\WinFupRep.bat"
+psexec \\%Rechnername% -s "c:\windows\system32\WinFupRep.bat"
+del "\\%Rechnername%\c$\windows\system32\WinFupRep.bat"
+goto eof
+
+
+
+:eof
+if "%errorlevel%"=="0" color 02 & goto farbegesetzt
+if "%errorlevel%"=="1" (color 02) else (color 0c)
+:farbegesetzt
+
+echo ****************************************************************************
+echo ***** Abgeschlossen - Error Code beachten! ***
+echo ****************************************************************************
+pause
+cls
+goto start
\ No newline at end of file
diff --git a/CMD/FUP_FIX/TEST.txt b/CMD/FUP_FIX/TEST.txt
new file mode 100644
index 0000000..07cac80
--- /dev/null
+++ b/CMD/FUP_FIX/TEST.txt
@@ -0,0 +1,51 @@
+@echo off
+setlocal enabledelayedexpansion
+
+:: -------------------------------------------------------------------
+:: Konfiguration
+:: -------------------------------------------------------------------
+set "CACHE=C:\Windows\sccmcache" :: Basisordner, in dem aufgerumt werden soll
+set "KEEPFILE=SETUP123.cmd" :: Datei, deren Ordner nicht gelscht werden darf
+
+:: -------------------------------------------------------------------
+:: Schritt 1: Pfad zu dem Ordner ermitteln, in dem die KEEPFILE liegt
+:: -------------------------------------------------------------------
+set "KEEPPATH="
+
+for /r "%CACHE%" %%F in (%KEEPFILE%) do (
+ if exist "%%F" (
+ set "KEEPPATH=%%~dpF" :: %%~dpF = Laufwerk + Pfad ohne Dateiname
+ )
+)
+
+:: Wenn Datei nicht gefunden wird ? Abbruch
+if not defined KEEPPATH (
+ echo Datei %KEEPFILE% wurde nicht gefunden!
+ exit /b 1
+)
+
+echo --------------------------------------------------
+echo Behalte Ordner: %KEEPPATH%
+echo --------------------------------------------------
+echo.
+
+:: -------------------------------------------------------------------
+:: Schritt 2: Alle Unterordner in sccmcache durchgehen
+:: -------------------------------------------------------------------
+for /d %%D in ("%CACHE%\*") do (
+ :: Vergleich: aktueller Ordner vs. KEEPPATH
+ if /i not "%%~fD\"=="%KEEPPATH%" (
+ :: wenn nicht der Behalte-Ordner ? lschen
+ echo Loesche: %%~fD
+ rmdir /s /q "%%~fD"
+ ) else (
+ echo Behalte: %%~fD
+ )
+)
+
+:: -------------------------------------------------------------------
+:: Schritt 3: Abschlussmeldung
+:: -------------------------------------------------------------------
+echo.
+echo Aufraeumen abgeschlossen.
+endlocal
diff --git a/CMD/FUP_FIX/WinFupRep.bat b/CMD/FUP_FIX/WinFupRep.bat
new file mode 100644
index 0000000..c70ef6a
--- /dev/null
+++ b/CMD/FUP_FIX/WinFupRep.bat
@@ -0,0 +1,94 @@
+::@echo off
+setlocal enabledelayedexpansion
+:: ==========================================
+:: Windows Health Repair @Erich Gasslmaier
+:: V 1.0
+:: Erstellt: %date% %time%
+:: ==========================================
+
+:: Logdatei mit Zeitstempel erstellen
+set LOGFILE=C:\WindowsHealth_%date:~-4%-%date:~3,2%-%date:~0,2%_%time:~0,2%-%time:~3,2%.log
+set LOGFILE=%LOGFILE: =0%
+
+echo ================================================== >> %LOGFILE%
+echo Windows Health Repair Script gestartet am %date% %time% >> %LOGFILE%
+echo ================================================== >> %LOGFILE%
+
+:: TrustedInstaller auf Auto setzen
+echo [SERVICE] TrustedInstaller auf automatisch stellen >> %LOGFILE%
+SC config trustedinstaller start=auto >> %LOGFILE% 2>&1
+
+
+:: Dienste stoppen
+echo [STOP DIENSTE] >> %LOGFILE%
+net stop bits >> %LOGFILE% 2>&1
+net stop wuauserv >> %LOGFILE% 2>&1
+net stop msiserver >> %LOGFILE% 2>&1
+net stop appidsvc >> %LOGFILE% 2>&1
+net stop cryptSvc >> %LOGFILE% 2>&1
+ping -n 11 127.0.0.1 > nul
+
+:: Update-Ordner bereinigen
+echo [CLEAN] SoftwareDistribution und Catroot2 >> %LOGFILE%
+if exist %Systemroot%\SoftwareDistribution.old rd /s /q %Systemroot%\SoftwareDistribution.old >> %LOGFILE% 2>&1
+Ren %Systemroot%\SoftwareDistribution SoftwareDistribution.old >> %LOGFILE% 2>&1
+
+if exist %Systemroot%\System32\catroot2.old rd /s /q %Systemroot%\System32\catroot2.old >> %LOGFILE% 2>&1
+Ren %Systemroot%\System32\catroot2 catroot2.old >> %LOGFILE% 2>&1
+
+:: DLLs neu registrieren
+echo [DLL REG] >> %LOGFILE%
+regsvr32.exe /s atl.dll >> %LOGFILE% 2>&1
+regsvr32.exe /s urlmon.dll >> %LOGFILE% 2>&1
+regsvr32.exe /s mshtml.dll >> %LOGFILE% 2>&1
+
+:: Netzwerk-Komponenten zur?cksetzen
+echo [NETSH RESET] >> %LOGFILE%
+netsh winsock reset >> %LOGFILE% 2>&1
+netsh winsock reset proxy >> %LOGFILE% 2>&1
+
+:: Alte Treiberreste entfernen
+echo [DRIVER CLEANUP] >> %LOGFILE%
+rundll32.exe pnpclean.dll,RunDLL_PnpClean /DRIVERS /MAXCLEAN >> %LOGFILE% 2>&1
+
+:: DISM Pr?fungen & Reparaturen
+echo [DISM SCANHEALTH] >> %LOGFILE%
+dism /Online /Cleanup-image /ScanHealth >> %LOGFILE% 2>&1
+
+echo [DISM CHECKHEALTH] >> %LOGFILE%
+dism /Online /Cleanup-image /CheckHealth >> %LOGFILE% 2>&1
+
+echo [DISM RESTOREHEALTH] >> %LOGFILE%
+dism /Online /Cleanup-image /RestoreHealth >> %LOGFILE% 2>&1
+
+echo [DISM COMPONENT CLEANUP] >> %LOGFILE%
+dism /Online /Cleanup-image /StartComponentCleanup >> %LOGFILE% 2>&1
+
+:: Systemdateien pruefen
+echo [SFC SCAN] Kann lange dauern >> %LOGFILE%
+sfc /scannow
+echo Y | chkdsk C: /F /R /B >> %LOGFILE% 2>&1
+
+:: Dienste wieder starten
+:: Wird bei neustart gemacht
+
+:: -------------------------------------------------------------------
+:: Konfiguration SCCM loeschen
+:: -------------------------------------------------------------------
+::for /d %i in ("C:\Windows\ccmcache\*") do rd /s /q "%i" >> %LOGFILE% 2>&1
+rd /s /q C:\Windows\ccmcache\ >> %LOGFILE% 2>&1
+:: -------------------------------------------------------------------
+:: Schritt 3: Abschlussmeldung
+:: -------------------------------------------------------------------
+echo.
+echo SCCM Aufraeumen abgeschlossen.
+
+:: Fertig
+echo ================================================== >> %LOGFILE%
+echo Script abgeschlossen am %date% %time% >> %LOGFILE%
+echo Logfile: %LOGFILE% >> %LOGFILE%
+echo Client neu Starten
+echo und Windows FUP Update nochmals starten
+echo ==================================================
+echo Fertig! Details siehe %LOGFILE%
+
diff --git a/CMD/Festplatte_voll.zip b/CMD/Festplatte_voll.zip
new file mode 100644
index 0000000..a613c42
Binary files /dev/null and b/CMD/Festplatte_voll.zip differ
diff --git a/CMD/Festplatte_voll/Festplatte voll - Verknüpfung.lnk b/CMD/Festplatte_voll/Festplatte voll - Verknüpfung.lnk
new file mode 100644
index 0000000..006447a
Binary files /dev/null and b/CMD/Festplatte_voll/Festplatte voll - Verknüpfung.lnk differ
diff --git a/CMD/Festplatte_voll/GUI_CLEANUP_HDD.bat b/CMD/Festplatte_voll/GUI_CLEANUP_HDD.bat
new file mode 100644
index 0000000..ac65ab4
--- /dev/null
+++ b/CMD/Festplatte_voll/GUI_CLEANUP_HDD.bat
@@ -0,0 +1,214 @@
+@echo off
+::
+::
+:startnew
+cls
+::set Arbeitsverzeichnis=%1"
+::set Arbeitsverzeichnis=%Arbeitsverzeichnis:"=%
+set Arbeitsverzeichnis=%~dp0
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo -* *-
+echo -* *-
+echo **
+echo ** # # # # **
+echo ** ###### ##### User:%USERNAME% **
+echo ** **
+echo ** - HDD CLEANUP TOOL - **
+echo ** ==================== **
+echo *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+echo ** **
+echo * - M-E-N-U-E - *
+echo ** ______________ **
+echo ** **
+echo ** 1.)= Komplettreinigung **
+echo ** ----------------- **
+echo ** 2.)= Hibernate ausschalten **
+echo ** --------------------- **
+echo ** 3.)= Hibernate einschalten **
+echo ** --------------------- **
+echo ** 4.)= Pagefile manuell setzen **
+echo ** ----------------------- **
+echo ** **
+echo ** 0.)= Neue Eingabe **
+echo ** _____________ **
+echo ***-----------------------------------------------------------***
+echo * Tipp: Alle Applikationen vorher schliessen! *
+echo ***-----------------------------------------------------------***
+echo * *
+echo * Durchfuehrungen fuer Komplettreinigung: *
+echo * -------------------------------------- *
+echo * *
+echo * - Cleanmgr.exe mit allen Optionen (System-User) *
+echo * - Hibernate aus- und wieder einschalten *
+echo * - SCCM-Cache leeren *
+echo * - Auslagerungsdatei wird auf D:\ mit 8128MB verschoben *
+echo * - alle OST-Dateien werden geloescht *
+echo * - Cleanmgr.exe mit allen Optionen (Std-User) *
+echo * - Ausgabe der Infos fuer Benutzerkontengroesse etc. *
+echo * *
+echo * *
+echo *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+echo.
+set /p Rechnername= Bitte CLIENT-ID/Hostnamen eingeben :
+
+::OS prfung 64/32bit
+if exist "\\%Rechnername%\c$\windows\SysWOW64" (set bitVersion=64) else (set bitVersion=32)
+
+
+::Prfen, ob Rechner anpingbar ist.
+ping %Rechnername% -n 1
+sleep 1
+::IF NOT %ERRORLEVEL%==0 echo ***** ACHTUNG: Rechner konnte nicht angepingt werden !**
+::IF NOT %ERRORLEVEL%==0 set ERRORLEVEL=2 & goto EOF
+
+:: 1008er Version hat keine psexec mehr.
+if NOT exist "\\%Rechnername%\c$\Program Files (x86)\Tools\" (copy "%VERZ%\pkg\psexec.exe" "\\%Rechnername%\c$\Windows\System32\psexec.exe" /Y)
+
+::GerteTyp festlegen
+set geraeteTyp=%Rechnername:~6,1%
+
+echo.
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo ** **
+echo ** Rechnername:%Rechnername% **
+echo ** **
+echo ** Geraetetyp=%geraeteTyp% **
+echo ** (C= Client) **
+echo ** (L= Laptop) **
+echo ** **
+echo ** Betriebsystem:Windows 7-%bitVersion%bit **
+echo ** **
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo.
+set /p Reparatur=Bitte waehlen Sie eine Option (1-4/0=neue Eingabe) aus:
+
+if "%Reparatur%"=="1" goto rep1
+if "%Reparatur%"=="2" goto rep2
+if "%Reparatur%"=="3" goto rep3
+if "%Reparatur%"=="4" goto rep4
+if "%Reperatur%"=="0" goto EOF
+
+
+:rep1
+
+time /t
+copy "%Arbeitsverzeichnis%SYSTEM EXECCLEANUP.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM EXECCLEANUP.bat"
+copy "%Arbeitsverzeichnis%SIZE.bat" "\\%Rechnername%\c$\windows\system32\SIZE.bat"
+copy "%Arbeitsverzeichnis%Set1337.reg" "\\%Rechnername%\c$\windows\system32\Set1337.reg"
+copy "%Arbeitsverzeichnis%clearcache.vbs" "\\%Rechnername%\c$\windows\system32\clearcache.vbs"
+copy "%Arbeitsverzeichnis%speicher.ps1" "\\%Rechnername%\c$\windows\system32\speicher.ps1"
+
+psexec \\%Rechnername% -s "SYSTEM EXECCLEANUP.bat" %geraeteTyp% -f
+sleep 10
+
+::psexec \\%Rechnername% cleanmgr.exe /sagerun:1337
+sleep 10
+
+echo.
+echo *******************************************************************************
+echo ******** Ausgabe Infos ********
+echo *******************************************************************************
+echo.
+echo *******************************************************************************
+echo ******** Benutzerdaten ********
+echo *******************************************************************************
+echo.
+psexec \\%Rechnername% -s SIZE.bat c:\Users
+echo.
+echo *******************************************************************************
+echo ******** WindowsLogs ********
+echo *******************************************************************************
+echo.
+psexec \\%Rechnername% -s SIZE.bat c:\windows\logs
+echo.
+echo *******************************************************************************
+echo ******** Freier Speicher ********
+echo *******************************************************************************
+Powershell -NoExit -Executionpolicy ByPass -noprofile -Command "&'c:\Windows\System32\speicher.ps1'"
+pause
+echo.
+echo.
+echo *******************************************************************************
+echo ******** Temp. Ordner ********
+echo *******************************************************************************
+echo.
+psexec \\%Rechnername% -s SIZE.bat c:\windows\temp
+echo.
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM EXECCLEANUP.bat"
+del "\\%Rechnername%\c$\Windows\System32\SIZE.bat"
+del "\\%Rechnername%\c$\Windows\System32\Set1337.reg"
+del "\\%Rechnername%\c$\Windows\System32\clearcache.vbs"
+del "\\%Rechnername%\c$\Windows\System32\speicher.ps1"
+cls
+goto EOF
+
+
+:rep2
+
+echo.
+echo *******************************************************************************
+echo ******* Hibernate wird deaktiviert! *******
+echo ****** !! ACHTUNG !!: ******
+echo ***** Nun kein Ruhezustand mehr moeglich, nur in Absprache mit AW! *****
+echo *******************************************************************************
+psexec \\%Rechnername% -s powercfg /hibernate off
+timeout 10
+cls
+goto EOF
+
+
+:rep3
+
+echo.
+echo *******************************************************************************
+echo ******* Hibernate wird aktiviert ! *******
+echo ****** !! ACHTUNG !!: ******
+echo ***** Einstellungen erst nach einem neustart moeglich! *****
+echo *******************************************************************************
+psexec \\%Rechnername% -s powercfg /hibernate on
+psexec \\%Rechnername% -s powercfg -hibernate -size 100
+timeout 10
+cls
+goto EOF
+
+
+:rep4
+
+set /p partition=Zielfestplatte eingeben (c/d):
+set /p size=Groesse angeben in MB (6144, 12288):
+
+psexec \\%Rechnername% -s REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /f /v PagingFiles /t REG_MULTI_SZ /d "%partition%:\pagefile.sys %size% %size%"
+goto EOF
+cls
+
+:EOF
+echo.
+echo ***************************************************************************
+echo *****************************************************************************
+echo ******* Bereinigung/Vorgang abgeschlossen! ********
+echo ****** Neustart zum kompletten Abschluss benoetigt *******
+echo ****** *******
+echo ****** Hibernate in Problemfaellen kurzzeitig ausschalten *******
+echo ******* ********
+echo ****************************************************************************
+echo **************************************************************************
+echo.
+
+echo.
+
+if "%errorlevel%"=="0" color 02 & goto farbegesetzt
+if "%errorlevel%"=="1" (color 02) else (color 0c)
+
+:farbegesetzt
+echo.
+echo *****************************************************************************
+echo *******************************************************************************
+echo ***** *****
+echo ***** Druecken Sie eine beliebige Taste um ins Menue zu gelangen....! *****
+echo ***** *****
+echo *******************************************************************************
+echo *****************************************************************************
+echo.
+pause
+color 0f
+goto startnew
\ No newline at end of file
diff --git a/CMD/Festplatte_voll/SET1337.reg b/CMD/Festplatte_voll/SET1337.reg
new file mode 100644
index 0000000..7e39d37
Binary files /dev/null and b/CMD/Festplatte_voll/SET1337.reg differ
diff --git a/CMD/Festplatte_voll/SIZE.bat b/CMD/Festplatte_voll/SIZE.bat
new file mode 100644
index 0000000..1a955df
--- /dev/null
+++ b/CMD/Festplatte_voll/SIZE.bat
@@ -0,0 +1,23 @@
+@echo off & setlocal & set Fkilo=0& title Ordnergroessen
+::
+::
+
+if "%~1"=="" (set "pfad=%~dp0" ) else set "pfad=%~1"
+if not "%pfad:~-1%" == "\" set "pfad=%pfad%\"
+for /d %%i in ("%pfad%*.*") do for /f "tokens=1-3" %%a in ('dir "%%i" /a /s /-c ^|findstr "Datei(en)"') do set "..?%%~i=%%c"
+for /f "tokens=2,3 delims=?=" %%i in ('set.. 2^>nul') do (echo %%i hat: %%j bytes& set /a folders + = 1 &call :rechner %%j)
+echo Gesamtgroesse fuer %pfad%
+if defined folders (echo %Fpeta%%Fgiga%%Fkilo% bytes& goto :eof ) else echo "%pfad%" enthaelt keine Ordner!& goto :eof
+:rechner
+set /a gignr = 0 , petnr = 0
+set alls=%1
+if %alls% gtr 999999 (set giga=%alls:~ 0, -6%& set /a gignr + = 1 , kilo = 1%alls:~-6%) else (set /a kilo = %alls:~-6% , giga = 0 , peta = 0 & goto :woutgig )
+if %giga% gtr 999999 (set peta=%giga:~ 0, -6%& set /a petnr + = 1 , giga = 1%giga:~-6%) else (set /a giga = %giga:~-6% , peta = 0)
+:woutgig
+set Falls=%Fpeta%%Fgiga%%Fkilo%
+if %Falls% gtr 999999 (set Fgiga=%Falls:~ 0, -6%& set /a Fkilo = 1%Falls:~ -6% + kilo , gignr + = 1) else (set /a Fkilo = %Falls% + kilo , Fgiga = 0 , Fpeta = 0 )
+if %Fgiga% gtr 999999 (set Fpeta=%Fgiga:~ 0, -6%& set /a Fgiga = 1%Fgiga:~ -6% + giga - gignr + %Fkilo:~ 0, -6% 2>nul , petnr + = 1) else (set /a Fgiga = %Fgiga% + giga - gignr + %Fkilo:~ 0, -6% 2>nul, Fpeta = 0 )
+if %Fpeta% gtr 0 set /a Fpeta = Fpeta + peta - petnr + %Fgiga:~ 0, -6% ,
+set Fkilo=%Fkilo:~ -6%
+if %Fgiga% == 0 (set "Fgiga=") else set Fgiga=%Fgiga:~ -6%
+if %Fpeta% == 0 set "Fpeta="
diff --git a/CMD/Festplatte_voll/SYSTEM EXECCLEANUP.bat b/CMD/Festplatte_voll/SYSTEM EXECCLEANUP.bat
new file mode 100644
index 0000000..1146892
--- /dev/null
+++ b/CMD/Festplatte_voll/SYSTEM EXECCLEANUP.bat
@@ -0,0 +1,117 @@
+@echo off
+::
+
+
+set geraeteTyp=%1
+echo.
+echo *****************************************************************
+echo ** **
+echo ** SCCM-Cache leeren **
+echo ** **
+echo *****************************************************************
+echo ***************************************************************
+echo.
+cscript clearcache.vbs
+sleep 10
+
+::vssadmin /Delete Shadows /For=C: /Oldest /Quiet
+echo *****************************************************************
+echo ** **
+echo ** Schattenkopien auf System werden bereinigt und neu gesetzt **
+echo ** **
+echo *****************************************************************
+echo **************************************************************
+echo.
+cd\
+cd c:\Windows\system32 /-f
+vssadmin List Shadows
+vssadmin List Volumes
+vssadmin Delete Shadows /For=C: /Oldest /Quiet
+vssadmin Delete Shadows /For=D: /Oldest /Quiet
+vssadmin Resize ShadowStorage /For=C: /On=C: /MaxSize=4%
+vssadmin Resize ShadowStorage /For=D: /On=D: /MaxSize=6%
+
+sleep 10
+
+echo.
+echo ****************************************************************
+echo ** **
+echo ** Hibernate-Datei neu aufbauen **
+echo ** **
+echo ******************************************************************
+echo ****************************************************************
+echo.
+powercfg /hibernate off
+
+sleep 5
+
+
+::Einschalten der Hibernate nur gerteTyp L=Laptop
+echo geraetetyp: %geraeteTyp%
+if "%geraeteTyp%"=="l" powercfg /hibernate on -size 100
+
+if "%geraeteTyp%"=="L" powercfg /hibernate on -size 100
+
+if "%geraeteTyp%"=="c" powercfg /hibernate off
+
+if "%geraeteTyp%"=="C" powercfg /hibernate off
+echo *****************************************************************************
+echo ***** *****
+echo ***** Hibernate-Datei ist aktiviert und ******
+echo ***** groesse auf max. 100% des vorhandenen Arbeitsspeicherts! ******
+echo *******************************************************************************
+echo.
+
+
+echo ***************************************************************************
+echo ******** ********
+echo ******** Temporary Internet Files loeschen ********
+echo ******** ********
+echo *****************************************************************************
+c:
+cd c:\users
+for /f "delims=" %%a in ('dir /ad /b /s "Temporary Internet Files"') do echo "%%a" & rd /s /q "%%a"
+
+
+sleep 10
+
+echo *****************************************************************************
+echo ******** ********
+echo ******** Umdisponierung der Auslagerungsdatei ********
+echo ******** ********
+echo *****************************************************************************
+::REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /f /v PagingFiles /t REG_MULTI_SZ /d "D:\pagefile.sys 8128 8128"
+
+sleep 10
+
+echo *****************************************************************************
+echo ******** ********
+echo ******** OST-Dateien loeschen ********
+echo ******** ********
+echo *****************************************************************************
+cd\
+cd c:\users
+for /F "delims=" %%a in ('dir /b /aD') do echo "%%a\AppData\Local\Microsoft\Outlook\*.ost" & del /Q "%%a\AppData\Local\Microsoft\Outlook\*.ost"
+
+echo ***************************************************************************
+echo ******** HDD-Cleanup ********
+echo *******************************************************************************
+echo *****************************************************************************
+echo **** ......................Regs werden gesetzt............................****
+echo *****************************************************************************
+
+::Cleanmgr /sageset:1337
+regedit /s Set1337.reg
+echo.
+echo.
+echo ************************************************************************
+echo ***** HDD-Cleanup aller Laufwerke ********
+echo ***** Datentraegerbereinigung, wird ausgefuehrt! ********
+echo ****** Dies kann einige Minuten dauern! ********
+echo **************************************************************************
+Cleanmgr /sagerun:1337
+Cleanmgr /sagerun:65535
+sleep 40
+:EOF
+exit
+
\ No newline at end of file
diff --git a/CMD/Festplatte_voll/clearcache.vbs b/CMD/Festplatte_voll/clearcache.vbs
new file mode 100644
index 0000000..01617b0
--- /dev/null
+++ b/CMD/Festplatte_voll/clearcache.vbs
@@ -0,0 +1,29 @@
+on error resume next
+dim oUIResManager
+dim oCache
+dim oCacheElement
+dim oCacheElements
+
+set oUIResManager = createobject("UIResource.UIResourceMgr")
+
+if oUIResManager is nothing then
+wscript.quit
+end if
+
+set oCache=oUIResManager.GetCacheInfo()
+
+if oCache is nothing then
+ set oUIResManager=nothing
+ wscript.quit
+end if
+
+set oCacheElements=oCache.GetCacheElements
+
+for each oCacheElement in oCacheElements
+ oCache.DeleteCacheElement(oCacheElement.CacheElementID)
+next
+
+set oCacheElements=nothing
+set oUIResManager=nothing
+set oCache=nothing
+wscript.quit
\ No newline at end of file
diff --git a/CMD/Java_1.8.reg b/CMD/Java_1.8.reg
new file mode 100644
index 0000000..98645c6
Binary files /dev/null and b/CMD/Java_1.8.reg differ
diff --git a/CMD/LSA.xml b/CMD/LSA.xml
new file mode 100644
index 0000000..5e279cd
Binary files /dev/null and b/CMD/LSA.xml differ
diff --git a/CMD/Powershell/Power.bat b/CMD/Powershell/Power.bat
new file mode 100644
index 0000000..69f3c5a
--- /dev/null
+++ b/CMD/Powershell/Power.bat
@@ -0,0 +1,116 @@
+@echo off
+::
+::
+:start
+cls
+set VERZ=%~dp0
+color 0f
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo -* *-
+echo -* User:%USERNAME% *-
+echo ** **
+echo ** **
+echo ** **
+echo ** **
+echo ** **
+echo ** **
+echo ** **
+echo ** **
+echo ** - Powershell - **
+echo ** ==================== **
+echo *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+echo ** **
+echo * - M-E-N-U-E - *
+echo ** ______________ **
+echo ** **
+echo ** 1.)= Powershell **
+echo ** ----------------- **
+echo ** 2.)= **
+echo ** --------------------- **
+echo ** 3.)= **
+echo ** _____________ **
+echo ***-----------------------------------------------------------***
+echo * *
+echo * *
+echo * *
+echo *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+echo.
+set /p Rechnername= Bitte CLIENT-ID / Hostnamen eingeben :
+
+::Prfen, ob Rechner anpingbar ist.
+ping %Rechnername% -n 1
+
+IF NOT %ERRORLEVEL%==0 echo ***** ACHTUNG: Rechner konnte nicht angepingt werden
+IF NOT %ERRORLEVEL%==0 set ERRORLEVEL=2 & goto eof
+
+
+
+set /p Reparatur=Bitte waehlen Sie eine Option aus:
+echo ==============================================
+if "%Reparatur%"=="1" set RepInfo="Power"
+if "%Reparatur%"=="2" set RepInfo="Leer"
+if "%Reparatur%"=="0" set RepInfo="neue Eingabe"
+
+set geraeteTyp=%Rechnername:~6,1%
+
+
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo ** **
+echo ** Rechnername: %Rechnername% **
+echo ** **
+echo ** Geraetetyp: %geraeteTyp% **
+echo ** (C= Client) **
+echo ** (L= Laptop) **
+echo ** **
+echo ** Betriebsystem: Windows -%bitVersion%bit **
+echo ** **
+echo ** Auswahl war:%RepInfo% **
+echo ** **
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo.
+
+goto init
+
+goto eof
+
+:init
+
+if "%Reparatur%"=="1" goto Power
+if "%Reparatur%"=="2" goto 22
+
+goto eof
+
+:Power
+echo *******************************************************************************
+echo ***** ********
+echo *******************************************************************************
+echo ***** ...Bitte warten, Power wird durchgefhrt.... ********
+echo *******************************************************************************
+robocopy "%VERZ%\source" "\\%Rechnername%\c$\Temp\Power" /mir
+::robocopy "%VERZ%\SCCM_Client" "\\%Rechnername%\c$\Temp" /mir
+psexec \\%Rechnername% -s "c:\temp\Power\_install.cmd" -f
+goto eof
+
+
+:22
+echo *******************************************************************************
+echo ***** 222222222222222222 ********
+echo *******************************************************************************
+echo ***** ...Bitte warten, Installation wird durchgefhrt.... ********
+echo *******************************************************************************
+
+goto eof
+
+
+
+:eof
+if "%errorlevel%"=="0" color 02 & goto farbegesetzt
+if "%errorlevel%"=="1" (color 02) else (color 0c)
+:farbegesetzt
+
+echo ****************************************************************************
+echo ***** AKTIVIERUNG Abgeschlossen - Error Code beachten! ***
+echo ****************************************************************************
+pause
+cls
+goto start
\ No newline at end of file
diff --git a/CMD/Powershell/Source/AppDeployToolkit/AppDeployToolkitBanner.png b/CMD/Powershell/Source/AppDeployToolkit/AppDeployToolkitBanner.png
new file mode 100644
index 0000000..b3ca050
Binary files /dev/null and b/CMD/Powershell/Source/AppDeployToolkit/AppDeployToolkitBanner.png differ
diff --git a/CMD/Powershell/Source/AppDeployToolkit/AppDeployToolkitConfig.xml b/CMD/Powershell/Source/AppDeployToolkit/AppDeployToolkitConfig.xml
new file mode 100644
index 0000000..40a5c14
Binary files /dev/null and b/CMD/Powershell/Source/AppDeployToolkit/AppDeployToolkitConfig.xml differ
diff --git a/CMD/Powershell/Source/Deploy-Application.exe b/CMD/Powershell/Source/Deploy-Application.exe
new file mode 100644
index 0000000..f2daa69
Binary files /dev/null and b/CMD/Powershell/Source/Deploy-Application.exe differ
diff --git a/CMD/Powershell/Source/Files/Win7AndW2K8R2-KB3191566-x64.msu b/CMD/Powershell/Source/Files/Win7AndW2K8R2-KB3191566-x64.msu
new file mode 100644
index 0000000..cf1eb50
Binary files /dev/null and b/CMD/Powershell/Source/Files/Win7AndW2K8R2-KB3191566-x64.msu differ
diff --git a/CMD/Powershell/Source/_Install.cmd b/CMD/Powershell/Source/_Install.cmd
new file mode 100644
index 0000000..ca34309
--- /dev/null
+++ b/CMD/Powershell/Source/_Install.cmd
@@ -0,0 +1,11 @@
+@echo off
+REM ************************************************************
+REM _Install.cmd
+REM
+REM ************************************************************
+
+set VERZN=%~dp0
+"%VERZN%\Deploy-Application.exe" -DeploymentType Install
+
+echo Errorlevel: %ERRORLEVEL%
+EXIT %ERRORLEVEL%
\ No newline at end of file
diff --git a/CMD/RDP_Rep.bat b/CMD/RDP_Rep.bat
new file mode 100644
index 0000000..7fdfee1
--- /dev/null
+++ b/CMD/RDP_Rep.bat
@@ -0,0 +1,4 @@
+set /p RemoteHost=Bitte ClientID eingeben:
+sc \\%RemoteHost% config SessionEnv start= demand
+sc \\%RemoteHost% config TermService start= demand
+pause
\ No newline at end of file
diff --git a/CMD/RDP_credSSP_schalter_Admin_Starten.bat b/CMD/RDP_credSSP_schalter_Admin_Starten.bat
new file mode 100644
index 0000000..2c146bd
--- /dev/null
+++ b/CMD/RDP_credSSP_schalter_Admin_Starten.bat
@@ -0,0 +1,83 @@
+@echo off
+::
+::
+:start
+cls
+::
+set VERZ=%~dp0
+echo.
+set Arbeitsverzeichnis=%1"
+set Arbeitsverzeichnis=%Arbeitsverzeichnis:"=%
+color 0f
+echo.
+echo =================================
+echo ************************************************
+echo ** **
+echo ** -= RDP CredSSP umschalter=- **
+echo ** **
+echo ************************************************
+echo =================================
+echo.
+echo === Systemzeit : %Time% UHR ===
+echo === User : %USERNAME% ===
+echo ***********************************************************************
+echo ****** = M-E-N-U-E = ****
+echo ***********************************************************************
+echo *** 0 = Aktivieren UNSICHER Aufschaltung moeglich ****
+echo *** 1 = Deaktivieren SAVE ****
+echo ***********************************************************************
+echo ***********************************************************************
+echo.
+
+
+set /p Reparatur=Bitte waehlen Sie eine Option aus:
+
+if "%Reparatur%"=="0" goto rep0
+if "%Reparatur%"=="1" goto rep1
+
+
+:: **************************************** Rep 0 ****************************************
+:rep0
+REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters\ /v AllowEncryptionOracle /t REG_DWORD /d 2
+pause
+if %ERRORLEVEL% == 0 goto ende
+goto errfehler
+:: **************************************** Rep 0 ****************************************
+
+:: **************************************** Rep 1 ****************************************
+:rep1
+REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters\ /v AllowEncryptionOracle /t REG_DWORD /d 0
+::pause
+::if %ERRORLEVEL% == 0 goto ende
+goto ende
+::goto errfehler
+:: **************************************** Rep 1 ****************************************
+
+
+
+
+:errfehler
+echo ***************************************************************************
+echo *****************************************************************************
+echo ***** *****
+echo ***** Ausfuehrung FEHLER ... *****
+echo ***** *****
+echo *****************************************************************************
+echo ***************************************************************************
+color 0c
+goto farbegesetzt
+
+:ende
+echo ***************************************************************************
+echo *****************************************************************************
+echo ***** *****
+echo ***** Ausfuehrung erfolgreich ... *****
+echo ***** *****
+echo *****************************************************************************
+echo ***************************************************************************
+color 02
+goto farbegesetzt
+
+:farbegesetzt
+Pause
+goto start
diff --git a/CMD/Remote-Verwaltung.cmd b/CMD/Remote-Verwaltung.cmd
new file mode 100644
index 0000000..c8afa18
--- /dev/null
+++ b/CMD/Remote-Verwaltung.cmd
@@ -0,0 +1,245 @@
+@echo off
+cls
+set VERZ=%~dp0
+REM ------------------------------------------------------------
+REM
+REM ------------------------------------------------------------
+REM Zustzliche Befehle fr die Computer Remoteverwaltung
+REM ------------------------------------------------------------
+REM WMIMgmt = start mmc C:\Windows\System32\WmiMgmt.msc /computer:localhost
+REM Aufganbenplanung start mmc C:\Windows\System32\taskschd.msc /computer:localhost
+REM Perfmon = start mmc C:\Windows\System32\perfmon.msc /computer:localhost
+REM Freigegebene Ordner = start mmc C:\Windows\System32\fsmgmt.msc /computer:localhost
+REM ------------------------------------------------------------
+REM Verwendete Administrative Tools
+REM ------------------------------------------------------------
+REM PsTools von Windows Sysinternals --> http://technet.microsoft.com/de-de/sysinternals/bb896649.aspx
+REM FreeCommander XE Portable --> http://www.freecommander.com/de/fc_downl_de.htm
+REM ------------------------------------------------------------
+
+
+REM ------------------------------------------------------------
+:: Variablen definieren (Diese Varaiablen sollten angepasst werden)
+REM ------------------------------------------------------------
+REM set NetShare=Z:
+REM set DomainAdminUser=DomainAdminUser
+REM set ScriptPath=D:\Scripts\Remoteverwaltung
+REM set FreeCommanderPath=D:\Scripts\Remoteverwaltung\FreeCommander
+REM ------------------------------------------------------------
+
+
+REM ------------------------------------------------------------
+:: Eingabe des zu verwaltenden Computers
+REM ------------------------------------------------------------
+echo ====================================================================================================
+echo Bitte Remote Computername oder IP-Adresse eingeben um das Skript starten zu koennen (z.B. localhost)
+echo ====================================================================================================
+set /p RemoteHost=Computername oder IP-Adresse eingeben:
+echo RemoteHost=%RemoteHost% > %ScriptPath%\RemoteHostVar.txt
+
+
+REM ------------------------------------------------------------
+:: C$ Freigabe vom Remote Computer verbinden
+REM ------------------------------------------------------------
+REM echo C$ Freigabe zu %RemoteHost% verbinden -- Bitte Passwort eingeben
+REM if exist %NetShare% net use /delete %NetShare% /yes
+REM net use %NetShare% "\\%RemoteHost%\c$" /persistent:no /user:%USERDOMAIN%\%DomainAdminUser%
+
+
+:START
+title Computer Remoteverwaltung mit %RemoteHost%
+mode 80,50
+cls
+
+
+REM ------------------------------------------------------------
+:: Anzeigetext in der Batchdatei definieren
+REM ------------------------------------------------------------
+echo.
+echo ============================================================
+echo Aktion waehlen (1-15) - Derzeit verbunden mit %RemoteHost%
+echo ============================================================
+echo.
+echo 1) Remote Computer wechseln
+echo 2) Ping %RemoteHost%
+echo 3) nslookup %RemoteHost%
+echo 4) FreeCommander (Explorer) starten
+echo 5) Dienste MMC von %RemoteHost% starten
+echo 6) Computerverwaltung MMC von %RemoteHost% starten
+echo 7) Ereignisanzeige MMC von %RemoteHost% starten
+echo 8) Prozesse von %RemoteHost% anzeigen
+echo 9) Registry Editor starten
+echo 10) neue CMD Konsole starten
+echo 11) Wer ist an %RemoteHost% angemeldet
+echo 12) Benutzer am %RemoteHost% abmelden
+echo 13) Computer %RemoteHost% neu starten
+echo 14) Remoteunterstuetzung starten
+echo 15) Exit
+echo.
+echo ============================================================
+
+
+REM ------------------------------------------------------------
+:: Auswahl wird in die Variable %choice% geschrieben
+REM ------------------------------------------------------------
+set /p choice=Auswahl:
+
+if "%choice%"=="1" goto CHANGECOMPUTER
+if "%choice%"=="2" goto PING
+if "%choice%"=="3" goto NSLOOKUP
+if "%choice%"=="4" goto FREECOMMANDER
+if "%choice%"=="5" goto SERVICES
+if "%choice%"=="6" goto COMPMGMT
+if "%choice%"=="7" goto EVENTMGMT
+if "%choice%"=="8" goto PROCESS
+if "%choice%"=="9" goto REGEDIT
+if "%choice%"=="10" goto OPENCMD
+if "%choice%"=="11" goto LOGGEDON
+if "%choice%"=="12" goto LOGOFF
+if "%choice%"=="13" goto REBOOT
+if "%choice%"=="14" goto REMOTEHELP
+if "%choice%"=="15" net use /delete %NetShare% /yes && exit
+
+
+REM ===================================================
+:CHANGECOMPUTER
+set /p RemoteHost=Bitte neuen Computername oder IP-Adresse eingeben:
+echo RemoteHost=%RemoteHost% > %ScriptPath%\RemoteHostVar.txt
+
+echo C$ Freigabe zu %RemoteHost% verbinden -- Bitte Passwort eingeben
+if exist %NetShare% net use /delete %NetShare% /yes
+net use %NetShare% "\\%RemoteHost%\c$" /persistent:no /user:%USERDOMAIN%\%DomainAdminUser%
+
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:PING
+ping -n 2 -4 %RemoteHost%
+
+echo.
+echo Bitte Taste druecken um zurueck zum Auswahlmenue zu kommen
+pause >nul
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:NSLOOKUP
+nslookup %RemoteHost%
+
+echo.
+echo Bitte Taste druecken um zurueck zum Auswahlmenue zu kommen
+pause >nul
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:FREECOMMANDER
+start %FreeCommanderPath%\FreeCommander.exe
+
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:SERVICES
+start mmc "%SystemRoot%\System32\services.msc" /computer:%RemoteHost%
+
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:COMPMGMT
+start mmc "%SystemRoot%\System32\compmgmt.msc" /computer:%RemoteHost%
+
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:EVENTMGMT
+start mmc "%SystemRoot%\System32\eventvwr.msc" /computer:%RemoteHost%
+
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:PROCESS
+sc \\%RemoteHost% start RemoteRegistry
+pslist -t -s -r 5 \\%RemoteHost%
+
+echo.
+echo Bitte Taste druecken um zurueck zum Auswahlmenue zu kommen
+pause >nul
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:REGEDIT
+sc \\%RemoteHost% start RemoteRegistry
+%SystemRoot%\System32\regedt32.exe && mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup('Bitte ueber [Datei] --> [Mit Netzwerkregistrierung verbinden], den Computernamen eingeben. Fenster schliesst automatisch nach 10 Sekunden.',10, 'Remote Registry', 64 );close()"
+
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:OPENCMD
+start /i %COMSPEC% /separate /k (for /f "tokens=*" %%i in (%ScriptPath%\RemoteHostVar.txt) do set "%%i")2>nul
+
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:LOGGEDON
+sc \\%RemoteHost% start RemoteRegistry
+psloggedon \\%RemoteHost%
+
+echo.
+echo Bitte Taste druecken um zurueck zum Auswahlmenue zu kommen
+pause >nul
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:LOGOFF
+sc \\%RemoteHost% start RemoteRegistry
+start /i %COMSPEC% /seperate /k psexec \\%RemoteHost% query session && mshta "javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup('Um den Remote User abzumelden, bitte (logoff [ID]) eingeben und mit [Enter] besttigen. Fenster schliesst automatisch nach 10 Sekunden.',10, 'Remote User Logoff', 64 );close()"
+
+
+echo.
+echo Bitte Taste druecken um zurueck zum Auswahlmenue zu kommen
+pause >nul
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:REBOOT
+sc \\%RemoteHost% start RemoteRegistry
+%VERZ%\psshutdown.exe -r -t 5 \\%RemoteHost%
+
+echo.
+echo Bitte Taste druecken um zurueck zum Auswahlmenue zu kommen
+pause >nul
+goto START
+REM ===================================================
+
+
+REM ===================================================
+:REMOTEHELP
+msra.exe /offerRA %RemoteHost%
+
+echo.
+echo Bitte Taste druecken um zurueck zum Auswahlmenue zu kommen
+pause >nul
+goto START
+REM ===================================================
diff --git a/CMD/Remoteaufschaltung/00000409/CmRcViewerRes.dll b/CMD/Remoteaufschaltung/00000409/CmRcViewerRes.dll
new file mode 100644
index 0000000..9373b70
Binary files /dev/null and b/CMD/Remoteaufschaltung/00000409/CmRcViewerRes.dll differ
diff --git a/CMD/Remoteaufschaltung/00000409/_statvw.dll b/CMD/Remoteaufschaltung/00000409/_statvw.dll
new file mode 100644
index 0000000..3cb0cd8
Binary files /dev/null and b/CMD/Remoteaufschaltung/00000409/_statvw.dll differ
diff --git a/CMD/Remoteaufschaltung/00000409/baserc.dll b/CMD/Remoteaufschaltung/00000409/baserc.dll
new file mode 100644
index 0000000..4df7624
Binary files /dev/null and b/CMD/Remoteaufschaltung/00000409/baserc.dll differ
diff --git a/CMD/Remoteaufschaltung/00000409/climsgs.dll b/CMD/Remoteaufschaltung/00000409/climsgs.dll
new file mode 100644
index 0000000..4724925
Binary files /dev/null and b/CMD/Remoteaufschaltung/00000409/climsgs.dll differ
diff --git a/CMD/Remoteaufschaltung/00000409/compmgrres.dll b/CMD/Remoteaufschaltung/00000409/compmgrres.dll
new file mode 100644
index 0000000..c1a9247
Binary files /dev/null and b/CMD/Remoteaufschaltung/00000409/compmgrres.dll differ
diff --git a/CMD/Remoteaufschaltung/00000409/provmsgs.dll b/CMD/Remoteaufschaltung/00000409/provmsgs.dll
new file mode 100644
index 0000000..9f35626
Binary files /dev/null and b/CMD/Remoteaufschaltung/00000409/provmsgs.dll differ
diff --git a/CMD/Remoteaufschaltung/00000409/srvmsgs.dll b/CMD/Remoteaufschaltung/00000409/srvmsgs.dll
new file mode 100644
index 0000000..2f93493
Binary files /dev/null and b/CMD/Remoteaufschaltung/00000409/srvmsgs.dll differ
diff --git a/CMD/Remoteaufschaltung/CmRcViewer.exe b/CMD/Remoteaufschaltung/CmRcViewer.exe
new file mode 100644
index 0000000..de2d196
Binary files /dev/null and b/CMD/Remoteaufschaltung/CmRcViewer.exe differ
diff --git a/CMD/Remoteaufschaltung/REMOTE_SCCM.bat b/CMD/Remoteaufschaltung/REMOTE_SCCM.bat
new file mode 100644
index 0000000..04b930b
--- /dev/null
+++ b/CMD/Remoteaufschaltung/REMOTE_SCCM.bat
@@ -0,0 +1 @@
+runas /savecred /user:deaudi00\dn2fzuk-adm ".\CmRcViewer.exe"
\ No newline at end of file
diff --git a/CMD/Remoteaufschaltung/RdpCoreSccm.dll b/CMD/Remoteaufschaltung/RdpCoreSccm.dll
new file mode 100644
index 0000000..4561368
Binary files /dev/null and b/CMD/Remoteaufschaltung/RdpCoreSccm.dll differ
diff --git a/CMD/Remoteaufschaltung/rdpencom.dll b/CMD/Remoteaufschaltung/rdpencom.dll
new file mode 100644
index 0000000..60d150d
Binary files /dev/null and b/CMD/Remoteaufschaltung/rdpencom.dll differ
diff --git a/CMD/SCCM/GUI_SCCM_NEUINSTALLATION_1710.bat b/CMD/SCCM/GUI_SCCM_NEUINSTALLATION_1710.bat
new file mode 100644
index 0000000..ee0b37c
--- /dev/null
+++ b/CMD/SCCM/GUI_SCCM_NEUINSTALLATION_1710.bat
@@ -0,0 +1,167 @@
+@echo off
+::
+::
+:: 27.07.2018 Abfrage auf Ip sollte funktionieren.
+::
+::
+:start
+cls
+set Arbeitsverzeichnis=%1"
+set Arbeitsverzeichnis=%Arbeitsverzeichnis:"=%
+set VERZ=%~dp0
+color 0f
+echo.
+::echo =================================
+echo ****************************************
+echo ** **
+echo ** -= SCCM - Neu-Installation =- **
+echo ** **
+echo ****************************************
+echo === Systemzeit : %Time% UHR ===
+echo === User : %USERNAME% ===
+echo ********************************************************************
+echo ****** = M-E-N-U-E = ****
+echo *************************************************************************
+echo *** SCCM-Client-Komplett-Neuinstallation ***
+echo *** neu mit ClientID oder IP Adresse ***
+echo *****************************************************************************
+echo *******************************************************************************
+echo.
+echo.
+echo.
+set /p RemoteHost=Bitte ClientID "AUDIXXX12345678" eingeben:
+:: Gross kleinschreibung berichtigung
+set RemoteHost=%RemoteHost:a=A%
+set RemoteHost=%RemoteHost:i=I%
+set RemoteHost=%RemoteHost:n=N%
+::Abfrage ab nur ClientID
+IF "%RemoteHost:~,1%" == "A" GOTO bmmf
+
+::Ausfhrung nur bei IP eingabe
+Echo NE oder IN rechner?
+::Echo IN=1 NE=2
+set /p standz=Bitte Kuerzel eingeben Ingolstadt=IN Neckarsulm=NE:
+set standz=%standz:i=I%
+set standz=%standz:n=N%
+IF %standz% == NE (set RechnerName=%RemoteHost%)
+IF %standz% == IN (set RechnerName=%RemoteHost%)
+echo %standz%
+goto PING
+
+
+:: Restlichen FQDN NE oder IN auswerten
+:bmmf
+set namez=%RemoteHost:~4,1%
+IF "%namez:~,1%" == "N" (set standz=NE)
+IF "%namez:~,1%" == "I" (set standz=IN)
+::set RechnerName=%RemoteHost%.%standz%.audi.vwg
+
+IF %standz% == NE (set RechnerName=%RemoteHost%.%standz%.audi.vwg)
+IF %standz% == IN (set RechnerName=%RemoteHost%)
+
+
+:: Prfen, ob Rechner anpingbar ist.
+:PING
+ping %Rechnername% -n 1 | find "TTL"
+IF NOT %ERRORLEVEL%==0 echo ***** ACHTUNG: Rechner konnte nicht angepingt werden
+IF NOT %ERRORLEVEL%==0 goto START
+
+if NOT exist "\\%Rechnername%\c$\windows\" (echo **** KEIN ZUGRIFF AUF RECHNER, ALS ADM GESTARTET? **** & goto EOF)
+if exist "\\%Rechnername%\c$\windows\SysWOW64\" (set bitVersion=64) else (set bitVersion=32)
+
+::Pruefung auf Path Variable System32
+::psexec \\AUDIINC23973534 cmd "echo ;%PATH%; | find /C /I ";c:\Windows\System32;"" && if errorlevel 0 set errorlevel=-3 & goto EOF
+
+
+:infoausgabe
+echo **************************************************************************
+echo ****************************************************************************
+echo ***** *****
+echo ***** Rechnername: %Rechnername% *****
+echo ***** ================================= *****
+echo ***** IN/NE Site: %standz% *****
+echo ***** ========================== *****
+echo ***** *****
+echo ****************************************************************************
+echo **************************************************************************
+echo.
+echo.
+echo ***************************************************************************
+echo *****************************************************************************
+echo ***** *****
+echo ***** Bereinigung *****
+echo ***** *****
+echo *****************************************************************************
+echo ***************************************************************************
+echo.
+echo.
+echo.
+echo %VERZ%
+%verz%\psexec.exe \\%Rechnername% C:\Windows\ccmsetup\ccmsetup.exe /uninstall
+%verz%\psexec \\%Rechnername% certutil -store SMS
+%verz%\psexec \\%Rechnername% certutil -delstore SMS "SMS"
+
+copy "%VERZ%\SCCM_Client\int_proc.bat" "\\%Rechnername%\c$\windows\system32\int_proc.bat"
+%verz%\psexec \\%Rechnername% -s "int_proc.bat" -f
+del "\\%Rechnername%\c$\Windows\System32\int_proc.bat
+
+:Neuinstallation
+echo ***************************************************************************
+echo *****************************************************************************
+echo ***** *****
+echo ***** Neu-Installation lauft, Bitte warten... *****
+echo ***** *****
+echo *****************************************************************************
+echo ***************************************************************************
+echo.
+echo.
+echo.
+echo.
+
+robocopy "%VERZ%\SCCM_Client" "\\%Rechnername%\c$\Temp" /mir
+
+if "%standz%"=="in" (psexec.exe \\%Rechnername% -s c:\temp\instin1.cmd)
+if "%standz%"=="IN" (psexec.exe \\%Rechnername% -s c:\temp\instin1.cmd)
+if "%standz%"=="ne" (psexec.exe \\%Rechnername% -s c:\temp\instne1.cmd)
+if "%standz%"=="NE" (psexec.exe \\%Rechnername% -s c:\temp\instne1.cmd)
+
+
+
+if "%errorlevel%"=="0" color 02 & goto farbegesetzt
+if "%errorlevel%"=="1" color 0C & goto farbegesetztF
+if "%errorlevel%"=="2" color 0C & goto farbegesetztF
+if "%errorlevel%"=="3" color 0C & goto farbegesetztP
+
+
+:farbegesetzt
+echo ***************************************************************************
+echo ***************************************************************************
+echo ******** Installation abgeschlossen ********
+echo ***************************************************************************
+echo ***************************************************************************
+pause
+color 07
+cls
+goto start
+
+:farbegesetztF
+echo **************************************************************************
+echo **************************************************************************
+echo ******** Installation FEHLER ********
+echo **************************************************************************
+echo **************************************************************************
+pause
+color 07
+cls
+goto start
+
+:farbegesetztP
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Path Variable fehlerhaft ********
+echo *******************************************************************************
+echo *******************************************************************************
+pause
+color 07
+cls
+goto startnew
\ No newline at end of file
diff --git a/CMD/SCCM/PsExec.exe b/CMD/SCCM/PsExec.exe
new file mode 100644
index 0000000..446a8df
Binary files /dev/null and b/CMD/SCCM/PsExec.exe differ
diff --git a/CMD/SCCM/SCCM_Client/InstIN1.cmd b/CMD/SCCM/SCCM_Client/InstIN1.cmd
new file mode 100644
index 0000000..ed035e3
--- /dev/null
+++ b/CMD/SCCM/SCCM_Client/InstIN1.cmd
@@ -0,0 +1,3 @@
+@echo off
+::xcopy \\AUDIINSC0002.audi.vwg\clientsetup$\Clientinst\source\*.* c:\temp\source\ /s /e /y
+c:\temp\source\ccmsetup.exe /source:c:\temp\source SMSMP=AUDIINSC0005.audi.vwg SMSSITECODE=IN1 SMSSLP=https://AUDIINSC0005.audi.vwg /UsePKICert /NoCRLCheck /BITSPriority:HIGH /downloadtimeout:100 /forceinstall CCMENABLELOGGING=TRUE CCMLOGLEVEL=1 CCMLOGMAXSIZE=1000000 SMSCACHESIZE=20480
diff --git a/CMD/SCCM/SCCM_Client/InstNE1.cmd b/CMD/SCCM/SCCM_Client/InstNE1.cmd
new file mode 100644
index 0000000..d77004f
--- /dev/null
+++ b/CMD/SCCM/SCCM_Client/InstNE1.cmd
@@ -0,0 +1,3 @@
+@echo off
+xcopy \\AUDIINSC0002.audi.vwg\clientsetup$\Clientinst\source\*.* c:\temp\source\ /s /e /y
+c:\temp\source\ccmsetup.exe /source:c:\temp\source SMSMP=AUDINESC0002.audi.vwg SMSSITECODE=NE1 SMSSLP=https://AUDINESC0002.audi.vwg /UsePKICert /NoCRLCheck /BITSPriority:HIGH /downloadtimeout:100 /forceinstall CCMENABLELOGGING=TRUE CCMLOGLEVEL=1 CCMLOGMAXSIZE=1000000 SMSCACHESIZE=20480
\ No newline at end of file
diff --git a/CMD/SCCM/SCCM_Client/int_proc.bat b/CMD/SCCM/SCCM_Client/int_proc.bat
new file mode 100644
index 0000000..f362519
--- /dev/null
+++ b/CMD/SCCM/SCCM_Client/int_proc.bat
@@ -0,0 +1,33 @@
+@echo off
+::
+echo ************************************************************
+echo ***** Stoppen der Dienste ********
+echo ************************************************************
+NET STOP CCMEXEC
+NET STOP CmRcService
+
+echo ************************************************************
+echo ***** Timeout ********
+echo ************************************************************
+echo ***** Timeout fuer 30 Sekunden Dienste stoppen ********
+echo ************************************************************
+::sleep 30
+timeout 30 > NUL
+echo ************************************************************
+echo ***** Bereinigung ********
+echo ************************************************************
+echo ************************************************************
+
+
+REG DELETE HKLM\Software\Microsoft\CCM /f
+REG DELETE HKLM\Software\Microsoft\CCMSETUP /f
+REG DELETE HKLM\Software\Microsoft\SMS /f
+
+rd /s /q c:\Windows\CCM\
+rd /s /q c:\Windows\CCMCache\
+rd /s /q c:\Windows\CCMSetup\
+del /s /q c:\Windows\SMSCFG.INI
+
+echo ************************************************************
+echo ***** ENDE ********
+echo ************************************************************
\ No newline at end of file
diff --git a/CMD/SCCM/SCCM_Client/source/ccmsetup.cab b/CMD/SCCM/SCCM_Client/source/ccmsetup.cab
new file mode 100644
index 0000000..cfdffc4
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/ccmsetup.cab differ
diff --git a/CMD/SCCM/SCCM_Client/source/ccmsetup.exe b/CMD/SCCM/SCCM_Client/source/ccmsetup.exe
new file mode 100644
index 0000000..a9a5976
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/ccmsetup.exe differ
diff --git a/CMD/SCCM/SCCM_Client/source/ep_defaultpolicy.xml b/CMD/SCCM/SCCM_Client/source/ep_defaultpolicy.xml
new file mode 100644
index 0000000..8c70189
--- /dev/null
+++ b/CMD/SCCM/SCCM_Client/source/ep_defaultpolicy.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+
+
+ 2
+ 2
+ 2
+ 2
+
+
+ 1
+ 0
+ 0
+
+
+
+ 1
+ 0
+
+
+ 0
+ 1
+ 0
+ 8
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 1
+
+
+ 1
+ 0
+ 0
+ 1
+
+ InternalDefinitionUpdateServer|MicrosoftUpdateServer|MMPC
+ FileShares|InternalDefinitionUpdateServer|MicrosoftUpdateServer|MMPC
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+ True
+ False
+ True
+ False
+
+
+
+
+ True
+ False
+ True
+ False
+
+
+
+
+ True
+ False
+ True
+ False
+
+
+
+
+
+
diff --git a/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1031.CAB b/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1031.CAB
new file mode 100644
index 0000000..ff1178d
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1031.CAB differ
diff --git a/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1036.CAB b/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1036.CAB
new file mode 100644
index 0000000..ec28e6b
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1036.CAB differ
diff --git a/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1038.CAB b/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1038.CAB
new file mode 100644
index 0000000..efbd23b
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1038.CAB differ
diff --git a/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1040.CAB b/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1040.CAB
new file mode 100644
index 0000000..9a74d5b
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP1040.CAB differ
diff --git a/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP3082.CAB b/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP3082.CAB
new file mode 100644
index 0000000..65ea8f3
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/LanguagePack/CLP3082.CAB differ
diff --git a/CMD/SCCM/SCCM_Client/source/i386/client.msi b/CMD/SCCM/SCCM_Client/source/i386/client.msi
new file mode 100644
index 0000000..d3fc822
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/client.msi differ
diff --git a/CMD/SCCM/SCCM_Client/source/i386/microsoft.webview2.fixedversionruntime.x86.cab b/CMD/SCCM/SCCM_Client/source/i386/microsoft.webview2.fixedversionruntime.x86.cab
new file mode 100644
index 0000000..e46a728
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/microsoft.webview2.fixedversionruntime.x86.cab differ
diff --git a/CMD/SCCM/SCCM_Client/source/i386/microsoftpolicyplatformsetup.msi b/CMD/SCCM/SCCM_Client/source/i386/microsoftpolicyplatformsetup.msi
new file mode 100644
index 0000000..e5f316e
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/microsoftpolicyplatformsetup.msi differ
diff --git a/CMD/SCCM/SCCM_Client/source/i386/mmasetup-i386.exe b/CMD/SCCM/SCCM_Client/source/i386/mmasetup-i386.exe
new file mode 100644
index 0000000..c26fcbe
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/mmasetup-i386.exe differ
diff --git a/CMD/SCCM/SCCM_Client/source/i386/ndp462-kb3151800-x86-x64-allos-enu.exe b/CMD/SCCM/SCCM_Client/source/i386/ndp462-kb3151800-x86-x64-allos-enu.exe
new file mode 100644
index 0000000..825d685
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/ndp462-kb3151800-x86-x64-allos-enu.exe differ
diff --git a/CMD/SCCM/SCCM_Client/source/i386/vcredist_x86.exe b/CMD/SCCM/SCCM_Client/source/i386/vcredist_x86.exe
new file mode 100644
index 0000000..9c83de9
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/vcredist_x86.exe differ
diff --git a/CMD/SCCM/SCCM_Client/source/i386/windowsfirewallconfigurationprovider.msi b/CMD/SCCM/SCCM_Client/source/i386/windowsfirewallconfigurationprovider.msi
new file mode 100644
index 0000000..e5d48db
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/i386/windowsfirewallconfigurationprovider.msi differ
diff --git a/CMD/SCCM/SCCM_Client/source/scepinstall.exe b/CMD/SCCM/SCCM_Client/source/scepinstall.exe
new file mode 100644
index 0000000..daff40f
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/scepinstall.exe differ
diff --git a/CMD/SCCM/SCCM_Client/source/wimgapi.msi b/CMD/SCCM/SCCM_Client/source/wimgapi.msi
new file mode 100644
index 0000000..0e3221b
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/wimgapi.msi differ
diff --git a/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1031.CAB b/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1031.CAB
new file mode 100644
index 0000000..7ebc961
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1031.CAB differ
diff --git a/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1036.CAB b/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1036.CAB
new file mode 100644
index 0000000..f538017
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1036.CAB differ
diff --git a/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1038.CAB b/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1038.CAB
new file mode 100644
index 0000000..5333084
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1038.CAB differ
diff --git a/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1040.CAB b/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1040.CAB
new file mode 100644
index 0000000..fbfcf23
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP1040.CAB differ
diff --git a/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP3082.CAB b/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP3082.CAB
new file mode 100644
index 0000000..fcedfb6
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/x64/LanguagePack/CLP3082.CAB differ
diff --git a/CMD/SCCM/SCCM_Client/source/x64/client.msi b/CMD/SCCM/SCCM_Client/source/x64/client.msi
new file mode 100644
index 0000000..7ead22c
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/x64/client.msi differ
diff --git a/CMD/SCCM/SCCM_Client/source/x64/md4ws.msi b/CMD/SCCM/SCCM_Client/source/x64/md4ws.msi
new file mode 100644
index 0000000..4328b5e
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/x64/md4ws.msi differ
diff --git a/CMD/SCCM/SCCM_Client/source/x64/microsoftpolicyplatformsetup.msi b/CMD/SCCM/SCCM_Client/source/x64/microsoftpolicyplatformsetup.msi
new file mode 100644
index 0000000..7e3f1d0
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/x64/microsoftpolicyplatformsetup.msi differ
diff --git a/CMD/SCCM/SCCM_Client/source/x64/mmasetup-amd64.exe b/CMD/SCCM/SCCM_Client/source/x64/mmasetup-amd64.exe
new file mode 100644
index 0000000..a7fc399
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/x64/mmasetup-amd64.exe differ
diff --git a/CMD/SCCM/SCCM_Client/source/x64/vcredist_x64.exe b/CMD/SCCM/SCCM_Client/source/x64/vcredist_x64.exe
new file mode 100644
index 0000000..ddf6f79
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/x64/vcredist_x64.exe differ
diff --git a/CMD/SCCM/SCCM_Client/source/x64/windowsfirewallconfigurationprovider.msi b/CMD/SCCM/SCCM_Client/source/x64/windowsfirewallconfigurationprovider.msi
new file mode 100644
index 0000000..d638c46
Binary files /dev/null and b/CMD/SCCM/SCCM_Client/source/x64/windowsfirewallconfigurationprovider.msi differ
diff --git a/CMD/SCCMAuf.bat b/CMD/SCCMAuf.bat
new file mode 100644
index 0000000..5885095
--- /dev/null
+++ b/CMD/SCCMAuf.bat
@@ -0,0 +1,138 @@
+@echo off
+chpc 1252
+title SMMC FQDN Vervollstndigung
+
+:start
+cls
+COLOR 0f
+echo ***************************************************************************
+echo *****************************************************************************
+echo ***** *****
+echo ***** SCCM FQDN vervollstndigung *****
+echo ***** *****
+echo *****************************************************************************
+echo ***************************************************************************
+echo.
+echo.
+echo.
+Echo Return fr Eingabe.
+pause
+cls
+
+:: Set variable for InputBox:
+set myMessage=Bitte ClientID / IP eingeben.
+set myTitle=Bitte ClientID / IP eingeben
+:: call :subInputBox
+
+
+:: Gross Kleinschreibung Berichtigung
+set RemoteHost=%RemoteHost:a=A%
+set RemoteHost=%RemoteHost:i=I%
+set RemoteHost=%RemoteHost:n=N%
+
+::AbfrageIP
+IF "%namez:~,1%" == "A" goto norm
+echo.
+echo.
+set FQDN=%RemoteHost%
+echo ClientID %FQDN%
+goto :expl
+
+::Abfrage ab nur ClientID
+:norm
+IF "%RemoteHost:~,1%" == "A" GOTO bmmf
+
+:: Wenn fehlend ClientID, ergnzen
+set /p stand=1 Ingolstadt oder 2 Neckasulm:
+IF "%stand%"=="1" (set standz=IN)
+IF "%stand%"=="2" (set standz=NE)
+set /p client=1 Laptop 2 Festrechner 3 HILs:
+IF "%client%"=="1" (set clientz=L)
+IF "%client%"=="2" (set clientz=C)
+IF "%client%"=="3" (set clientz=W)
+set FQDN=AUDI%standz%%clientz%%RemoteHost%.%standz%.audi.vwg
+goto expl
+
+:: Restlichen FQDN NE oder IN auswerten
+:bmmf
+set namez=%RemoteHost:~4,1%
+IF "%namez:~,1%" == "N" (set standz=NE)
+IF "%namez:~,1%" == "I" (set standz=IN)
+set FQDN=%RemoteHost%.%standz%.audi.vwg
+goto expl
+
+:: PING test
+:expl
+echo.
+echo.
+echo Ping Test
+ping %FQDN% -n 1 | find "TTL"
+IF NOT %ERRORLEVEL%==0 echo ***** ACHTUNG: Rechner konnte nicht angepingt werden
+IF NOT %ERRORLEVEL%==0 pause
+IF NOT %ERRORLEVEL%==0 goto start
+
+:: Ausfhrung
+echo.
+echo.
+echo.
+echo AUSFHRUNG auf %FQDN%
+echo.
+\\audi.vwg\NETLOGON\ARS\CmRcViewer.exe %FQDN% \\SCCM
+if %ERRORLEVEL% == 0 goto ende
+goto errfehler
+
+:errfehler
+echo ***************************************************************************
+echo *****************************************************************************
+echo ***** *****
+echo ***** Ausfhrung FEHLER ... *****
+echo ***** *****
+echo *****************************************************************************
+echo ***************************************************************************
+color 0c
+goto farbegesetzt
+
+:ende
+echo ***************************************************************************
+echo *****************************************************************************
+echo ***** *****
+echo ***** Ausfhrung erfolgreich ... *****
+echo ***** *****
+echo *****************************************************************************
+echo ***************************************************************************
+color 02
+goto farbegesetzt
+
+:farbegesetzt
+echo.
+echo.
+Pause
+goto start
+
+:: Start subroutine subInputBox
+:subInputBox
+set VBS="%Temp%\vbsInputBox.vbs"
+set CMD="%Temp%\cmdVar.bat"
+>> %VBS% echo Option Explicit
+>> %VBS% echo Dim strText
+>> %VBS% echo Dim objShell : Set objShell = CreateObject("Wscript.Shell")
+>> %VBS% echo Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
+>> %VBS% echo Dim objFile : Set objFile = objFSO.CreateTextFile(%CMD%)
+:: Pass variable from batch to VBScript
+>> %VBS% echo strText = InputBox("%myMessage%", "%myTitle%")
+>> %VBS% echo if strText = vbNullString then
+:: Create batch file
+>> %VBS% echo objFile.WriteLine "@echo off"
+>> %VBS% echo objFile.WriteLine "set flag=false"
+>> %VBS% echo else
+>> %VBS% echo objFile.WriteLine "@echo off"
+:: Set variable in batch file
+>> %VBS% echo objFile.WriteLine "set RemoteHost=" ^& strText
+>> %VBS% echo end if
+>> %VBS% echo objFile.Close
+cscript %VBS% > NUL
+call %CMD% > NUL
+del %CMD%
+del %VBS%
+goto :EOF
+:: End subroutine subInputBox
\ No newline at end of file
diff --git a/CMD/SCCM_TRIGGER/SCCM_TRIGGER.bat b/CMD/SCCM_TRIGGER/SCCM_TRIGGER.bat
new file mode 100644
index 0000000..6b6eb31
--- /dev/null
+++ b/CMD/SCCM_TRIGGER/SCCM_TRIGGER.bat
@@ -0,0 +1,80 @@
+@echo off
+::
+::
+:start
+cls
+set VERZ=%~dp0
+color 0f
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo -* *-
+echo -* User:%USERNAME% *-
+echo ** **
+echo ** **
+echo ** - SCCM Trigger - **
+echo ** ==================== **
+echo *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+echo ** **
+echo ***-----------------------------------------------------------***
+echo * *
+echo * *
+echo * *
+echo *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+echo.
+set /p Rechnername= Bitte CLIENT-ID / Hostnamen eingeben :
+
+::Prfen, ob Rechner anpingbar ist.
+ping %Rechnername% -n 1
+::sleep 1
+IF NOT %ERRORLEVEL%==0 echo ***** ACHTUNG: Rechner konnte nicht angepingt werden
+IF NOT %ERRORLEVEL%==0 set ERRORLEVEL=2 & goto eof
+
+
+
+echo ==============================================
+
+
+
+set geraeteTyp=%Rechnername:~6,1%
+
+
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo ** **
+echo ** Rechnername: %Rechnername% **
+echo ** **
+echo ** Geraetetyp: %geraeteTyp% **
+echo ** (C= Client) **
+echo ** (L= Laptop) **
+echo ** **
+echo ** Betriebsystem: Windows -%bitVersion%bit **
+echo ** **
+echo ** Auswahl war:%RepInfo% **
+echo ** **
+echo -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
+echo.
+
+
+
+echo *******************************************************************************
+echo ***** SCCM Trigger ********
+echo *******************************************************************************
+echo ***** ...Bitte warten, aktion wird durchgefhrt.... ********
+echo *******************************************************************************
+echo %VERZ%int_proc.bat
+copy "%VERZ%int_proc.bat" "\\%Rechnername%\c$\temp\int_proc.bat"
+psexec \\%Rechnername% -s "c:\temp\int_proc.bat" -f
+del "\\%Rechnername%\c$\temp\int_proc.bat"
+goto eof
+
+
+
+:eof
+if "%errorlevel%"=="0" color 02 & goto farbegesetzt
+if "%errorlevel%"=="1" (color 02) else (color 0c)
+:farbegesetzt
+
+echo ****************************************************************************
+echo ***** Triggern Abgeschlossen - Error Code beachten! ***
+echo ****************************************************************************
+pause
+cls
+goto start
\ No newline at end of file
diff --git a/CMD/SCCM_TRIGGER/int_proc.bat b/CMD/SCCM_TRIGGER/int_proc.bat
new file mode 100644
index 0000000..5a9a520
--- /dev/null
+++ b/CMD/SCCM_TRIGGER/int_proc.bat
@@ -0,0 +1,17 @@
+
+::
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000121}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000003}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000010}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000001}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000021}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000022}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000002}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000031}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000108}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000113}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000111}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000026}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000027}" /NOINTERACTIVE
+WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000032}" /NOINTERACTIVE
+
diff --git a/CMD/SYSTEM_WMI.bat b/CMD/SYSTEM_WMI.bat
new file mode 100644
index 0000000..4464523
--- /dev/null
+++ b/CMD/SYSTEM_WMI.bat
@@ -0,0 +1,31 @@
+@echo off
+::
+::
+time /t
+
+echo ################################################################################
+echo ################################################################################
+echo WMI
+echo ################################################################################
+winmgmt /resyncperf
+winmgmt /salvagerepository
+winmgmt /resetrepository
+sc config winmgmt start= disabled
+net stop winmgmt /y
+net stop ccmexec /y
+%systemdrive%
+cd %windir%\system32\wbem
+For /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
+regsvr32 wmisvc.dll
+net start winmgmt
+net start ccmexec
+for /f %%s in ('dir /b *.mof *.mfl') do mofcomp %%s
+echo ################################################################################
+
+echo ################################################################################
+echo #### Der Rechner sollte nun neugestartet werden.
+echo ################################################################################
+
+time /t
+
+pause
diff --git a/CMD/TE-Storage-Dateimanager/GUI_Dateimanager.bat b/CMD/TE-Storage-Dateimanager/GUI_Dateimanager.bat
new file mode 100644
index 0000000..2dc90c8
--- /dev/null
+++ b/CMD/TE-Storage-Dateimanager/GUI_Dateimanager.bat
@@ -0,0 +1,117 @@
+@echo off
+::
+::
+
+:start
+cls
+set Arbeitsverzeichnis=%1"
+set Arbeitsverzeichnis=%Arbeitsverzeichnis:"=%
+set VERZ=%~dp0
+color 0f
+echo.
+echo =================================
+echo ****************************************
+echo ** **
+echo ** -= Dateimanager-Installation =- **
+echo ** **
+echo ****************************************
+echo === Systemzeit : %Time% UHR ===
+echo === User : %USERNAME% ===
+echo ********************************************************************
+echo ****** = M-E-N-U-E = ****
+echo *************************************************************************
+echo *****************************************************************************
+echo *******************************************************************************
+echo.
+echo.
+echo.
+set /p RemoteHost=Bitte ClientID "AUDIXXX12345678" eingeben:
+:: Gross kleinschreibung berichtigung
+set RemoteHost=%RemoteHost:a=A%
+set RemoteHost=%RemoteHost:i=I%
+set RemoteHost=%RemoteHost:n=N%
+
+
+
+:: Prfen, ob Rechner anpingbar ist.
+ping %RemoteHost% -n 1 | find "TTL"
+IF NOT %ERRORLEVEL%==0 echo ***** ACHTUNG: Rechner konnte nicht angepingt werden
+IF NOT %ERRORLEVEL%==0 goto START
+
+::if NOT exist "\\%RemoteHost%\c$\windows\" (echo **** KEIN ZUGRIFF AUF RECHNER, ALS ADM GESTARTET? **** & goto EOF)
+::if exist "\\%RemoteHost%\c$\windows\SysWOW64\" (set bitVersion=64) else (set bitVersion=32)
+
+
+
+
+:infoausgabe
+echo **************************************************************************
+echo ****************************************************************************
+echo ***** *****
+echo ***** Rechnername: %RemoteHost% *****
+echo ***** ================================= *****
+echo ***** *****
+echo ***** ========================== *****
+echo ***** *****
+echo ****************************************************************************
+echo **************************************************************************
+echo.
+echo.
+echo ***************************************************************************
+echo *****************************************************************************
+echo ***** *****
+echo ***** Installation *****
+echo ***** *****
+echo *****************************************************************************
+echo ***************************************************************************
+echo.
+echo.
+echo.
+
+
+
+copy "%VERZ%\setup.msi" "\\%RemoteHost%\c$\temp\setup.msi"
+copy "%VERZ%\inst.bat" "\\%RemoteHost%\c$\windows\system32\int_proc.bat"
+psexec \\%RemoteHost% -s "int_proc.bat" -f
+del "\\%RemoteHost%\c$\temp\setup.msi
+
+
+
+if "%errorlevel%"=="0" color 02 & goto farbegesetzt
+if "%errorlevel%"=="1" color 0C & goto farbegesetztF
+if "%errorlevel%"=="2" color 0C & goto farbegesetztF
+if "%errorlevel%"=="3" color 0C & goto farbegesetztP
+
+
+:farbegesetzt
+echo ***************************************************************************
+echo ***************************************************************************
+echo ******** Installation abgeschlossen ********
+echo ***************************************************************************
+echo ***************************************************************************
+pause
+color 07
+cls
+goto start
+
+:farbegesetztF
+echo **************************************************************************
+echo **************************************************************************
+echo ******** Installation FEHLER ********
+echo **************************************************************************
+echo **************************************************************************
+pause
+color 07
+cls
+goto start
+
+:farbegesetztP
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Path Variable fehlerhaft ********
+echo *******************************************************************************
+echo *******************************************************************************
+pause
+color 07
+cls
+goto startnew
\ No newline at end of file
diff --git a/CMD/TE-Storage-Dateimanager/inst.bat b/CMD/TE-Storage-Dateimanager/inst.bat
new file mode 100644
index 0000000..1b92909
--- /dev/null
+++ b/CMD/TE-Storage-Dateimanager/inst.bat
@@ -0,0 +1 @@
+msiexec /i C:\temp\setup.msi /qn
\ No newline at end of file
diff --git a/CMD/TE-Storage-Dateimanager/psexec.exe b/CMD/TE-Storage-Dateimanager/psexec.exe
new file mode 100644
index 0000000..70a7435
Binary files /dev/null and b/CMD/TE-Storage-Dateimanager/psexec.exe differ
diff --git a/CMD/TE-Storage-Dateimanager/setup.msi b/CMD/TE-Storage-Dateimanager/setup.msi
new file mode 100644
index 0000000..a481485
Binary files /dev/null and b/CMD/TE-Storage-Dateimanager/setup.msi differ
diff --git a/CMD/Zert Pfad.JPG b/CMD/Zert Pfad.JPG
new file mode 100644
index 0000000..27d719c
Binary files /dev/null and b/CMD/Zert Pfad.JPG differ
diff --git a/CMD/ZertifikatRemote.bat b/CMD/ZertifikatRemote.bat
new file mode 100644
index 0000000..cb13d74
--- /dev/null
+++ b/CMD/ZertifikatRemote.bat
@@ -0,0 +1,62 @@
+@echo off
+:startnew
+set VERZ=%~dp0
+cls
+set Arbeitsverzeichnis=%1"
+set Arbeitsverzeichnis=%Arbeitsverzeichnis:"=%
+echo ************************************************
+echo **************************************************
+echo **** ****
+echo ** **
+echo *** ZertifikatsTool ***
+echo **** ****
+echo *************************************************
+echo ********************************************************************
+echo ***** ******
+echo *******************************************************************************
+
+set /p Rechnername= Bitte Rechnernamen/Hostnamen eingeben:
+
+
+:: Prfen, ob Rechner anpingbar ist.
+ping %Rechnername% -n 1 | find "TTL"
+IF NOT %ERRORLEVEL%==0 echo ***** ACHTUNG: Rechner konnte nicht angepingt werden
+IF NOT %ERRORLEVEL%==0 goto rep2
+
+psexec \\%Rechnername% certutil -store My
+
+
+echo.
+echo *******************************************************************************
+echo ******** Zertifikat Aussteller: CN=MS-CA-AUDI-02, O=Audi AG, C=DE ********
+echo ******** ist aktuell. NICHT LOESCHEN ********
+echo *******************************************************************************
+echo ******** Zertifikat Aussteller: CN=MS-CA-AUDI-01, O=Audi AG, C=DE ********
+echo ******** veraltet / loeschen ********
+echo *******************************************************************************
+echo.
+echo ***************************************************
+echo ******** 0-8 Zertifikat Nr loeschen ********
+echo ******** 9= Abbruch. Zert --OK ********
+echo ***************************************************
+echo.
+echo.
+set /p optionnr="Bitte waehlen Sie die Zertifikatsnummer aus die geloescht werden soll."
+
+if "%optionnr%"=="9" goto rep2
+
+:rep1
+%VERZ%\psexec \\%Rechnername% certutil -delstore MY %optionnr%
+%VERZ%\psexec \\%Rechnername% gpupdate /force
+echo.
+echo ***************************************************
+echo ******** ********
+echo ******** Rechner bitte neustarten ********
+echo ******** ********
+echo ***************************************************
+echo.
+pause
+
+:rep2
+
+goto startnew
diff --git a/CMD/psexec.bat b/CMD/psexec.bat
new file mode 100644
index 0000000..ea284ee
--- /dev/null
+++ b/CMD/psexec.bat
@@ -0,0 +1,7 @@
+@echo off
+set VERZ=%~dp0
+
+set /p RemoteHost=Bitte ClientID eingeben:
+%verz%\psexec \\%RemoteHost% -s cmd
+::%verz%\psexec \\%RemoteHost% -s systeminfo
+pause
diff --git a/CMD/psexec.exe b/CMD/psexec.exe
new file mode 100644
index 0000000..446a8df
Binary files /dev/null and b/CMD/psexec.exe differ
diff --git a/CMD/psexecinst.bat b/CMD/psexecinst.bat
new file mode 100644
index 0000000..0e07608
--- /dev/null
+++ b/CMD/psexecinst.bat
@@ -0,0 +1,6 @@
+set VERZ=%~dp0
+echo ----------------------------------------------------------
+echo Es wird einmalig PSexec in das System32 Verz. kopiert
+echo ----------------------------------------------------------
+copy %VERZ%\psexec.exe c:\windows\system32\"
+pause
\ No newline at end of file
diff --git a/CMD/psshutdown.exe b/CMD/psshutdown.exe
new file mode 100644
index 0000000..8106ceb
Binary files /dev/null and b/CMD/psshutdown.exe differ
diff --git a/CMD/putty.exe b/CMD/putty.exe
new file mode 100644
index 0000000..0593f1b
Binary files /dev/null and b/CMD/putty.exe differ
diff --git a/CMD/sccmrep.cmd b/CMD/sccmrep.cmd
new file mode 100644
index 0000000..cbf8de9
--- /dev/null
+++ b/CMD/sccmrep.cmd
@@ -0,0 +1,34 @@
+@echo off
+Echo This batch file will Set Service Object Security for WUAUSERV & BITS.
+REM Result will be written to %temp%\SetServiceObjectSecurity.log and then launched in Notepad.
+Echo Please wait...
+@echo on
+sc sdset bits "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)" >%temp%\SetServiceObjectSecurity.log
+sc sdset wuauserv "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)" >>%temp%\SetServiceObjectSecurity.log
+@echo off
+
+notepad %temp%\SetServiceObjectSecurity.log
+Echo Open %temp%\SetServiceObjectSecurity.log for SUCCESS entry.
+Echo Open the Services applet from control panel to see if the services are started.
+Echo For any errors; report on http://groups.msn.com/NTarabia
+@echo off
+Pause
+
+& also check below command
+
+msiexec.exe /unregister
+msiexec.exe /regserver
+REGSVR32 WUPS2.DLL /S
+REGSVR32 WUPS.DLL /S
+REGSVR32 WUAUENG.DLL /S
+REGSVR32 WUAPI.DLL /S
+REGSVR32 MUCLTUI.DLL /S
+REGSVR32 WUCLTUI.DLL /S
+REGSVR32 WUWEB.DLL /S
+REGSVR32 MUWEB.DLL /S
+REGSVR32 QMGR.DLL /S
+REGSVR32 QMGRPRXY.DLL /S
+regsvr32 atl.dll /s
+C:\
+sc sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
+pause
\ No newline at end of file
diff --git a/Clientcheck/Errorhandling.xml b/Clientcheck/Errorhandling.xml
new file mode 100644
index 0000000..880e2ca
--- /dev/null
+++ b/Clientcheck/Errorhandling.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+ AudiSysWrapper.exe
+
+
+ Infoblende.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe>
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ VW-Wrapper
+
+
+ MSIEXEC.exe;Wusa.exe
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ Infoblende.exe
+
+
+ Wusa.exe
+
+
+
+
+
+
+ MSIEXEC.exe;*.exe
+
+
+ Wusa.exe
+ install
+
+
+ Wusa.exe
+ uninstall
+
+
+ Wusa.exe>
+ install
+
+
+
\ No newline at end of file
diff --git a/Clientcheck/_Functions.vbs b/Clientcheck/_Functions.vbs
new file mode 100644
index 0000000..8e91a40
--- /dev/null
+++ b/Clientcheck/_Functions.vbs
@@ -0,0 +1,2865 @@
+'=================================================
+'For document history look at changelog.docx
+'=================================================
+Option Explicit
+
+'----- Globale Variablen
+Dim WSHShell, FSO, WSHNetwork, InstallDir, Computername, Parameter, LogName, Ret, ACVER, ASAPV, ASAPVER, LockScreenActive
+Dim currentDir, LogDir, ProgramFiles, ProgramFiles64, WinDir, Temp
+Dim DebugMode, LogEnabled
+Dim pValidity, pName, pOSValidity, pVersion, pLang, pRevision
+
+'----- Clients
+Dim ASAP_7 : ASAP_7 = 0
+Dim IDO_32 : IDO_32 = 0
+Dim C_IDO_32 : C_IDO_32 = 0
+Dim ACB_32_O : ACB_32_O = 0
+Dim AC1_32_O : AC1_32_O = 0
+Dim AC2_32_O : AC2_32_O = 0
+Dim C_IDO_64 : C_IDO_64 = 0
+Dim AC2_64_O : AC2_64_O = 0
+Dim AC3_Alpha : AC3_Alpha = 0
+
+Dim AC2_32_N : AC2_32_N = 0
+Dim AC2_64_N : AC2_64_N = 0
+
+Dim AC4_64_O : AC4_64_O = 0
+Dim AC4_64_N : AC4_64_N = 0
+
+'----- Objectdefinitionen
+Set WSHShell = CreateObject("WScript.Shell")
+Set FSO = CreateObject("Scripting.FileSystemObject")
+Set WSHNetwork = WScript.CreateObject("WScript.Network")
+
+'----- Standardvariablen setzen
+Computername = WshNetwork.ComputerName
+If WScript.Arguments.Count=1 Then Parameter=WScript.Arguments(0)
+ASAPV = ReadEnv("ASAPV")
+ACVER = ReadEnv("ACVER")
+ASAPVER = ReadEnv("ASAPVER")
+Temp = ReadEnv("TEMP")
+WinDir = ReadEnv("WINDIR")
+
+If GetOSBit() = 64 Then
+ ProgramFiles = ReadEnv("ProgramFiles(x86)")
+ ProgramFiles64 = ReadEnv("ProgramW6432")
+ If ProgramFiles64 = False Then ProgramFiles64 = ReadEnv("ProgramFiles")
+Else
+ ProgramFiles = ReadEnv("ProgramFiles")
+ ProgramFiles64 = ReadEnv("ProgramFiles")
+End If
+
+InstallDir = FSO.GetParentFolderName(WScript.ScriptFullName)
+WSHShell.CurrentDirectory = InstallDir
+currentDir = InstallDir
+
+LogDir = ProgramFiles64 & "\Audi\InstLogs\"
+'LogName = LogDir & pName & "_" & pVersion & "_" & pLang & "_" & pRevision & ".log"
+LogName = LogDir & pValidity & "_" & pName & "_" & pOSValidity & "_" & pVersion & "_" & pLang & "_" & pRevision & ".log"
+
+If LCase(Mid(Wscript.FullName, InstrRev(Wscript.FullName,"\")+1)) = "cscript.exe" Then
+ DebugMode = True
+End If
+LogEnabled = True
+
+ReDim errorList0(-1)
+
+'*********************
+'***** FUNCTIONS *****
+'*********************
+
+'----- Active Setup -----
+'Description: Creates an active setup
+'Usage: ActiveSetup()
+'Output: n/a
+'------------------------
+Function ActiveSetup()
+ Dim Name : Name = pName & "_" & pVersion & "_" & pLang & "_" & pRevision
+ Dim Pfad : Pfad = "wscript.exe ""c:\windows\sw-source\" & Name & "\ActiveSetup.vbs"" //B"
+ Dim Version : Version = pVersion
+ VbsLog "---------- Execute Active Setup Function: '" & Name & "' '" & Pfad & "' '" & Version & "'"
+ If CheckFolder ("ActiveSetup") Then
+ CreateFolder WinDir & "\SW-Source\" & Name
+ CopyFile "ActiveSetup\*.*", WinDir & "\SW-Source\" & Name & "\"
+ CopyFile ".\_Functions.vbs", WinDir & "\SW-Source\" & Name & "\"
+ End If
+
+ Version = Replace(Version,".",",")
+
+ Ret = WriteReg ("REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & Name & "\", "ActiveSetup " & Name, GetOSBit())
+ WriteReg "REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & Name & "\StubPath", Pfad, GetOSBit()
+ WriteReg "REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & Name & "\Version", Version, GetOSBit()
+
+ If Ret = True Then
+ VbsLog "---------- RESULT ActiveSetup: OK"
+ Else
+ ErrorHandling 1,"---------- RESULT ActiveSetup: ERROR"
+ End If
+End Function
+
+
+'----- Active Setup Remove (for Usage in _Uninstall.vbs) -----
+'Description: Removes an active setup
+'Usage: ActiveSetupRem()
+'Output: n/a
+'------------------------
+Function ActiveSetupRem()
+ Dim Name : Name = pName & "_" & pVersion & "_" & pLang & "_" & pRevision
+ DeleteReg "Key", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & Name, GetOSBit()
+ DeleteFolder WinDir & "\SW-Source\" & Name
+End Function
+
+
+'----- Client Info -----
+'Description: Prints the ClientInfo and sets Client variables
+'Usage: ClientInfo()
+'-----------------------
+Sub ClientInfo()
+ VbsLog "======================================================="
+ VbsLog " ClientInfo:"
+ VbsLog " Name: " & computerName
+ VbsLog " OS-Version: " & GetOSVersion()
+ VbsLog " ACVER: " & ACVER
+ VbsLog " ASAPV: " & ASAPV
+ VbsLog " ASAPVER: " & ASAPVER
+ VbsLog " Client: " & GetClientVersion()
+ VbsLog " Last boot time: " & GetLastBootTime()
+ VbsLog " Reboot required: " & GetRebootStatus()
+ VbsLog " Manufacturer: " & GetHardwareInfo("Manufacturer")
+ VbsLog " Model: " & GetHardwareInfo("Model")
+ VbsLog " Location: " & GetLocation()
+ VbsLog " User: " & GetCurrentUser()
+ VbsLog "======================================================="
+End Sub
+
+'----- Client Check -----
+'Description: Returns the client version, if version is valid; x if invalid
+'Usage: ClientCheck()
+'-----------------------
+Function ClientCheck()
+ Dim strComputer, objWMIService, objItem, colItems
+ Dim systype, objOS
+ Dim clientVersion, i
+ Dim arrClients
+
+ clientVersion = "x"
+
+ If(IDO_32 = 1) Then arrClients = arrClients + "i.Do1.X;"
+ If(C_IDO_32 = 1) Then arrClients = arrClients + "C-i.Do.1.X 32 Bit;"
+ If(C_IDO_64 = 1) Then arrClients = arrClients + "C-i.Do.1.X 64 Bit;"
+ If(ACB_32_O = 1) Then arrClients = arrClients + "AC-B-32-O;"
+ If(AC1_32_O = 1) Then arrClients = arrClients + "AC1-32-O;"
+ If(AC2_32_O = 1) Then arrClients = arrClients + "AC2-32-O;"
+ If(AC2_64_O = 1) Then arrClients = arrClients + "AC2-64-O;"
+ If(AC3_Alpha = 1) Then arrClients = arrClients + "AC3-Alpha;"
+
+ If(AC2_32_N = 1) Then arrClients = arrClients + "AC2-32-N;"
+ If(AC2_64_N = 1) Then arrClients = arrClients + "AC2-64-N;"
+
+ If(ASAP_7 = 1) Then arrClients = arrClients + "ASAP7.X;"
+
+ If(AC4_64_O = 1) Then arrClients = arrClients + "AC4-64-O;"
+ If(AC4_64_N = 1) Then arrClients = arrClients + "AC4-64-N;"
+
+
+ arrClients = Split(arrClients, ";")
+
+ clientVersion = GetClientVersion()
+
+ For i = LBound(arrClients) To UBound(arrClients)-1
+ If arrClients(i) = clientVersion Then
+ ClientCheck = clientVersion
+ Exit Function
+ End If
+ Next
+ ErrorHandling 16010, ""
+ FinishScript()
+End Function
+
+'----- Change Service -----
+'Description: Change Service startmode or state
+'Usage: ChangeService ,
+'Output: ErrorCode
+'Example: ChangeService "Spooler", "Restart"
+' ChangeService "Spooler", "Disabled"
+'--------------------------------------
+Function ChangeService(ServiceName, StartStop)
+ Dim WantStarted, DesiredState, StartedStopped, ServiceDescr, Result
+ Dim objWMIService, listOfServices, objService, WaitFor
+ Result = 0
+ Select Case LCase(StartStop)
+ Case "start"
+ StartStop = "Start"
+ StartedStopped = "started"
+ WantStarted = True
+ DesiredState = "Running"
+ case "stop"
+ StartStop = "Stop"
+ StartedStopped = "stopped"
+ WantStarted = False
+ DesiredState = "Stopped"
+ Case "manual"
+ StartStop = "Manual"
+ StartedStopped = "stopped"
+ WantStarted = False
+ DesiredState = "Stopped"
+ Case "disabled"
+ StartStop = "Disabled"
+ StartedStopped = "stopped"
+ WantStarted = False
+ DesiredState = "Stopped"
+ Case "automatic", "auto"
+ StartStop = "Auto"
+ StartedStopped = "started"
+ WantStarted = True
+ DesiredState = "Running"
+ Case "restart"
+ ChangeService ServiceName, "stop"
+ ChangeService ServiceName, "start"
+ Exit function
+ Case Else
+ VbsLog " Result: Failed - (Wrond Syntax) in Function:ChangeService"
+ Exit Function
+ End Select
+
+ ' get the service object
+ Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
+ Set listOfServices = objWMIService.ExecQuery("select * from Win32_Service where Name = '" & ServiceName & "'")
+
+ If listOfServices.Count = 0 Then
+ VbsLog "Information | Service '" & ServiceName & "' not found."
+ Else
+ For Each objService In listOfServices
+ ServiceDescr = "The " & objService.Name & " service"
+
+ 'DesiteState = Servicetype & Start or Stop
+ If LCase(DesiredState) = LCase(objService.State) And (LCase(StartStop) = LCase("start") Or LCase(startStop) = LCase("stop")) Then
+ VbsLog "Information | Change Service: " & ServiceDescr & " is already " & objService.State & "."
+ Exit Function
+ End If
+
+ 'StartStop <> Manual & DesiredState = State & StartStop = Servicetyp
+ If LCase(startStop) <> "manual" And LCase(DesiredState)= LCase(objService.State) And LCase(StartStop) = LCase(objService.StartMode) Then
+ VbsLog "Information | Change Service: " & ServiceDescr & " is already " & objService.State & "."
+ Exit Function
+ End If
+
+ ' change service startmode
+ If StartStop = "Disabled" Then
+ Result = objService.changestartmode("disabled")
+ ElseIf StartStop = "Manual" Then
+ Result = objService.changestartmode("manual")
+ ElseIf StartStop = "Auto" Then
+ Result = objService.changestartmode("automatic")
+ End If
+
+ 'change service to manual if disabled and StartMode is start
+ If LCase(StartStop) = lcase("Start") And LCase(objService.StartMode) = lcase("disabled") Then
+ Result = objService.changestartmode("Manual")
+ If Result = 0 Then
+ VbsLog "Information | Change Service: " & ServiceDescr & " changed to manual"
+ Else
+ Errorhandling 1, "Change Service: " & objService.Name
+ End If
+ End If
+
+ ' start or stop service
+ If WantStarted = True Then
+ Result = objService.StartService()
+ Else
+ Result = objService.StopService()
+ End If
+
+ ' display success or failure message
+ Select Case Result
+ Case 0, 5, 10
+ WaitFor = 60000 '60 seconds
+ While WaitFor > 0
+ WScript.Sleep(500) : WaitFor = WaitFor - 500 '0.5 seconds
+ Set objService = objWMIService.Get("Win32_Service.Name='" & ServiceName & "'")
+
+ 'check objService.State / DesiredState (Running/Stopped)
+ If LCase(DesiredState) = LCase(objService.State) Then
+ 'check objService.StartMode / StartStop
+ 'if value StartStop not: start / stop
+ If Not LCase(StartStop) = "start" And Not LCase(StartStop) = "stop" And LCase(objService.startmode) = LCase(StartStop) Then
+ VbsLog "OK | Change Service: " & ServiceDescr & " " & StartedStopped
+ VbsLog "OK | Change Service: " & ServiceDescr & " changed to " & StartStop
+ Exit Function
+ Else
+ VbsLog "OK | Change Service: " & ServiceDescr & " " & StartedStopped
+ If LCase(StartStop) = LCase("Disabled") Then
+ VbsLog "OK | Change Service: " & ServiceDescr & " changed to " & StartStop
+ End If
+ Exit Function
+ End If
+ Else
+ If WaitFor =< 1000 Then VbsLog "ERROR : Failed - in Function:ChangeService"
+ End If
+ Wend
+ Case 2
+ Errorhandling 2, "Change Service: " & ServiceDescr & _
+ " can't be changed because the user did not have the necessary access"
+ Case 3
+ Errorhandling 3, "Change Service: " & ServiceDescr & _
+ " can't be stopped because dependant services are running."
+ Case Else
+ Errorhandling Result, "Change Service: " & ServiceDescr & _
+ " is in state " & objService.State & "."
+ End Select
+ Next
+ ChangeService = Result
+ End If
+End Function
+
+'----- Delete Service -----
+'Description: Delete Service
+'Usage: DeleteService
+'Output: n/a
+'Example: DeleteService "Spooler"
+'--------------------------------------
+Function DeleteService(ServiceName)
+ Dim objWMIService,colListOfServices,objService
+ Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
+ Set colListOfServices = objWMIService.ExecQuery("Select * from Win32_Service Where Name = '" & ServiceName & "'")
+
+ If colListOfServices.Count = 0 Then
+ VbsLog "Information | Delete Service (Service doesn't exist) [" & ServiceName & "]"
+ Else
+ For Each objService in colListOfServices
+ objService.StopService()
+ objService.Delete()
+ VbsLog "OK | Service deleted: [" & ServiceName & "]"
+ Next
+ End If
+End Function
+
+'----- Check File -----
+'Description: Returns if file exists
+'Usage: CheckFile
+'Output: True / False
+'Example: CheckFile "c:\temp\text.txt"
+'--------------------------
+Function CheckFile(File)
+ CheckFile = FSO.FileExists(File)
+End Function
+
+'----- Check Folder -----
+'Description: Returns if folder exists
+'Usage: CheckFolder
+'Output: True / False
+'Example: CheckFolder "c:\temp"
+'--------------------------
+Function CheckFolder(Folder)
+ CheckFolder = FSO.FolderExists(Folder)
+End Function
+
+'----- Check Is Laptop -----
+'Description: Check if client is a Laptop
+'Usage: CheckIsLaptop()
+'Output: True or False
+'Example: CheckIsLaptop()
+'-------------------------
+Function CheckIsLaptop()
+ Dim strComputer, objWMIService, colItems, objItem
+ strComputer = "."
+ On Error Resume Next
+ Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/cimv2" )
+ Set colItems = objWMIService.ExecQuery( "Select * from Win32_Battery", , 48 )
+ CheckIsLaptop = False
+ For Each objItem in colItems
+ CheckIsLaptop = True
+ Next
+ If Err Then Err.Clear
+ On Error Goto 0
+End Function
+
+'----- Check Process -----
+'Description: Checks if process(es) is/are running
+'Usage: CheckProc
+'Output: True / False
+'Example: CheckProc "ccmexec.exe,windword.exe"
+'--------------------------
+Function CheckProc(strProcess)
+ Dim process,v,i
+
+ CheckProc = False
+ v=Split(strProcess,",")
+ For i=0 To UBound(v)
+ For Each process In GetObject("winmgmts://.").InstancesOf("win32_process")
+ If UCase(Process.name) = UCase(Trim(v(i))) Then
+ CheckProc = True
+ Exit Function
+ End If
+ Next
+ Next
+End Function
+
+'----- Check if Product installed -----
+'Description: Checks if a Product is installed
+'Usage: CheckProduct
+'Output: TRUE if Product is installed
+'Example: CheckProduct "{B332732A-4958-41DD-B439-DDA2D32753C5}"
+'--------------------------------------
+Function CheckProduct(ProductCode)
+ Dim objInstaller
+
+ Set objInstaller = WScript.CreateObject("WindowsInstaller.Installer")
+ ret = objInstaller.ProductState(ProductCode)
+ If ret = 5 Then
+ VbsLog "Installed: " & objInstaller.ProductInfo(ProductCode, "ProductName") & " (" & objInstaller.ProductInfo(ProductCode, "Publisher") & ") V" & objInstaller.ProductInfo(ProductCode, "VersionString")
+ CheckProduct = True
+ Else
+ VbsLog "Product is NOT installed (" & ProductCode & ")"
+ CheckProduct = False
+ End If
+End Function
+
+'----- Runs commandline and logs into logfile -----
+'Description: Runs a commandline and logs its output into the logfile
+'Usage: CommandWithOutput ,
+'Output: Exitcode
+'Example: CommandWithOutput "cmd /c dir c:\","0"
+'--------------------------------------
+Function CommandWithOutput(Command,Abbruch)
+ Dim output,objWSH_Exec,i,v
+ Const WSHRunning = &H0
+
+ VbsLog "Execute CommandWithOutput Function: '" & Command & "' '" & Abbruch & "'"
+ VbsLog "==========> Start CMD Command Output <=========="
+
+ WshShell.CurrentDirectory = InstallDir
+ Set objWSH_Exec = WshShell.Exec(command)
+
+ With objWSH_Exec
+ Do While .Status = WSHRunning
+ Do Until objWSH_Exec.StdOut.AtEndOfStream
+ output = objWSH_Exec.StdOut.ReadLine
+ VbsLog Trim(output)
+ Loop
+ Loop
+
+ Ret = objWSH_Exec.ExitCode
+ CommandWithOutput = Ret
+
+ VbsLog "==========> End CMD Command Output <=========="
+
+ If Abbruch = "" Then
+ VbsLog "+ RESULT CommandWithOutput: OK | Accepting all ExitCodes [" & Ret & "]"
+ Else
+ v=Split(Abbruch,",")
+ For i = LBound(v) To UBound(v)
+ If StrComp(Ret,v(i)) = 0 Then
+ VbsLog "+ RESULT CommandWithOutput: OK | Accepted ExitCode (" & v(i) & ", " & ErrorText(Ret) & " )"
+ Exit Function
+ End If
+ Next
+ VbsLog "+ RESULT CommandWithOutput: ERROR | ExitCode (" & Ret & ", " & ErrorText(Ret) & " )"
+ ErrorHandling Ret,ErrorText(Ret)
+ FinishScript()
+ End If
+ End With
+End Function
+
+'----- Copy File -----
+'Description: Copies File(s)
+'Usage: CopyFile ,
+'Output: True / False
+'Example: CopyFile "text.txt", "c:\temp\"
+' CopyFile "text.txt", "c:\temp\newtext.txt"
+'--------------------------
+Function CopyFile(Source,ByVal Dest)
+ Dim FSO
+ Set FSO = CreateObject("Scripting.FileSystemObject")
+ On Error Resume Next
+ FSO.CopyFile Source, Dest, True
+
+ If Err.Number = 70 Then
+ If Right(Dest, 1) = "\" And InStr(Source, "*") = 0 Then
+ If InStr(Source, "\") <> 0 Then
+ Dest = Dest & Right(Source,Len(Source) - InStrRev(Source, "\"))
+ Else
+ Dest = Dest & Source
+ End If
+ End If
+ Err.Clear
+ Ret = FSO.GetFile(Dest).Attributes
+ FSO.GetFile(Dest).Attributes = 0
+ FSO.CopyFile Source, Dest, True
+ FSO.GetFile(Dest).Attributes = Ret
+ End If
+
+ If Err.Number = 0 Then
+ CopyFile = True
+ VbsLog "OK | File copy: [" & source & "] --> [" & dest & "]"
+ Else
+ CopyFile = False
+ ErrorHandling Err.Number, "File copy: (" & Err.Description & "): [" & source & "] --> [" & dest & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Copy Folder -----
+'Description: Copy Folder(s)
+'Usage: CopyFolder ,
+'Output: True / False
+'Example: CopyFolder "redist", "c:\temp\"
+'-----------------------
+Function CopyFolder(Source,Dest)
+ Dim FSO
+ Set FSO = CreateObject("Scripting.FileSystemObject")
+ On Error Resume Next
+ FSO.CopyFolder Source,Dest,True
+ If Err.Number = 0 Then
+ CopyFolder = True
+ VbsLog "OK | Folder copy [" & source & "] --> [" & dest & "]"
+ Else
+ CopyFolder = False
+ ErrorHandling Err.Number, "Folder copy (" & Err.Description & "): [" & source & "] --> [" & dest & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Copy Folder XCopy -----
+'Description: Copy Folder(s) via XCopy
+'Usage: CopyFolderX ,
+'Output: Returncode of xcopy.exe
+'Example: CopyFolderX "C:\Programme\", "D:\Programme"
+'-----------------------
+Function CopyFolderX(fs, dest)
+ CreateFolder dest
+ CopyFolderX = run ("XCopy","xcopy.exe """ & fs & """ """ & dest & """ /E /R /Y /Q", "")
+End Function
+
+'----- Create Folder -----
+'Description: Create Folder
+'Usage: CreateFolder
+'Output: True / False
+'Example: CreateFolder "c:\temp\newfolder"
+'-------------------------
+Function CreateFolder(ByVal folder)
+ If Right(folder, 1) <> "\" Then folder = folder + "\"
+ Dim fso, pointer, newFolder
+ Set fso = CreateObject("Scripting.FileSystemObject")
+ pointer=0
+ On Error Resume Next
+ If FSO.FolderExists(Folder) = True Then
+ VbsLog "Information | Function CreateFolder. Folder [" & folder & "] exist."
+ CreateFolder = True
+ On Error Goto 0
+ Exit Function
+ End If
+ Do While pointer < Len(Folder)
+ pointer = InStr(pointer + 1,folder, "\")
+ newFolder = Left(folder, pointer)
+ If Not fso.FolderExists(newFolder) Then FSO.CreateFolder(newFolder)
+ Loop
+ If Err.Number = 0 Then
+ VbsLog "OK | Folder [" & folder & "] created."
+ CreateFolder = True
+ Else
+ ErrorHandling Err.Number, "Folder not created: " & Err.Description
+ CreateFolder = False
+ End If
+ On Error Goto 0
+End Function
+
+'----- Create ShortCut -----
+'Description: Create a shortcut
+'Usage: CreateShortCut , , , ,
+'Output: True / False
+'Example: CreateShortcut "C:\...\Desktop", "ShortCutName", WinDir & "\System32\cmd.exe", "C:\Test.ico, 5", "-c"
+'---------------------------
+Function CreateShortcut(lnkDestPath, ByVal lnkName, lnkTargetPath, IconLocation, lnkArguments) 'Bsp: CreateShortcut AllUsersProfile & "\Desktop", "ShortCutName", WinDir & "\System32\cmd.exe", "C:\Test.ico", "-c"
+ Dim oShellLink, lnkWorkingDirectory
+ Dim f, i, strPath
+ VbsLog "Execute CreateShortcut Function: '" & lnkDestPath & "' '" & lnkName & "' '" & lnkTargetPath & "' '" & IconLocation & "' '" & lnkArguments & "'"
+
+ On Error Resume Next
+ If Not Right(lnkTargetPath, 1) = "\" Then
+ f = Split(lnkTargetPath, "\")
+ If UBound(f) >= 1 Then
+ For i = 0 To UBound(f)-1
+ lnkWorkingDirectory = lnkWorkingDirectory & f(i) & "\"
+ Next
+ End If
+ Else
+ lnkWorkingDirectory = lnkTargetPath
+ End If
+
+ If Not Right(LCase(lnkname),4) = ".lnk" And Not Right(LCase(lnkName),4) = ".url" Then
+ lnkName = lnkName & ".lnk"
+ End If
+
+ If InStr(Right(LCase(IconLocation), 5),", ") = False Then IconLocation = IconLocation & ", 0"
+
+ 'Set WshShell = WScript.CreateObject("WScript.Shell")
+ Set oShellLink = WshShell.CreateShortcut(lnkDestPath & "\" & lnkName)
+ oShellLink.TargetPath = lnkTargetPath
+ 'oShellLink.WindowStyle = 1
+ If Not Right(LCase(lnkName),4) = ".url" Then
+ oShellLink.WorkingDirectory = lnkWorkingDirectory
+ oShellLink.IconLocation = IconLocation
+ oShellLink.Description = "Shortcut"
+ oShellLink.Arguments = lnkArguments
+ End If
+
+ oShellLink.Save
+
+ If Err.Number <> 0 Then
+ ErrorHandling Err.Number, "+ RESULT CreateShortcut: ERROR " & Err.Number & ", " & Err.Description
+ CreateShortcut = False
+ Else
+ VbsLog "+ RESULT CreateShortcut: OK"
+ CreateShortcut = True
+ End If
+
+ On Error Goto 0
+End Function
+
+'----- Create Task -----
+'Description: Creates Task
+'Usage: CreateTask , ,
+'Output: True / False
+'Example: CreateTask "Taskname","c:\temp\name.exe","EINMAL"
+'Parameter: : MINUTE, STNDLICH, TGLICH, MONATLICH, EINMAL, BEIMSTART, BEIANMELDUNG, BEILEERLAUF
+'-----------------------
+Function CreateTask (name, file, plan)
+ On Error Resume Next
+ Dim strArgument
+
+ If Left(GetOSVersion(), 1) = "6" Then strArgument = " /F"
+ If Left(GetOSVersion(), 2) = "10" Then strArgument = " /F"
+
+ Ret = WSHShell.Run ("schtasks.exe /create /tn """ & name & """ /tr """ & file & """ /sc " & plan & " /ru SYSTEM" & strArgument, 0, True)
+ If Ret <> 0 Then
+ CreateTask = False
+ ErrorHandling Ret, "ERROR (" & Ret & ") | Task not created: [" & name & "] [" & file & "] [" & plan & "]"
+ Else
+ CreateTask = True
+ VbsLog "OK | Task created: [" & name & "] [" & file & "] [" & plan & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Create Uninstall -----
+'Description: Creates Uninstall
+'Usage: CreateUninstall("")
+'Example: CreateUninstall "MySoftware"
+'----------------------------
+Function CreateUninstall(Name)
+ Dim v, strName, strPublisher, strVersion
+ VbsLog "---------- Execute CreateUninstall Function: '" & Name & "'"
+ v = Split(name, "_")
+ Select Case UBound(v)
+ Case 1,2 : strPublisher = v(0) : strName = v(1) : strVersion = pVersion
+ Case Else
+ v = Empty
+ v = Split(pName, "_")
+ If UBound(v) >= 1 Then
+ strPublisher = v(0) : strName = v(1) : strVersion = pVersion : Name = pName
+ Else
+ strPublisher = pName : strName = pName : strVersion = pVersion : Name = pName
+ End If
+ End Select
+
+ 'CreateFolder WinDir & "\SW-Source\" & Name
+ 'CopyFile "_Uninstall.vbs", WinDir & "\SW-Source\" & Name & "\"
+ 'CopyFile "_Functions.vbs", WinDir & "\SW-Source\" & Name & "\"
+
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\Displayname" ,strName,32
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\DisplayVersion" ,strVersion,32
+ WriteReg "DWORD","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\NoModify" ,1,32
+ WriteReg "DWORD","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\NoRepair" ,1,32
+ WriteReg "DWORD","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\NoRemove" ,1,32
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\Publisher" ,strPublisher,32
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\UninstallString","wscript.exe """ & WINDIR & "\sw-source\" & Name & "\_Uninstall.vbs"" //B",32
+ VbsLog "---------- RESULT CreateUninstall: OK"
+End Function
+
+'----- Delete File -----
+'Description: Deletes File(s)
+'Usage: DeleteFile
+'Output: True / False
+'Example: DeleteFile "c:\temp\text.txt"
+'-----------------------
+Function DeleteFile(File)
+ On Error Resume Next
+ FSO.DeleteFile File, True
+ If Err.Number = 0 Then
+ DeleteFile = True
+ VbsLog "OK | File delete: [" & File & "]"
+ ElseIf Err.Number = 53 Then
+ DeleteFile = False
+ VbsLog "Information | File delete (" & Err.Description & "): [" & File & "]"
+ Else
+ DeleteFile = False
+ ErrorHandling Err.Number, "File delete: (" & Err.Description & ") [" & File & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Delete Folder -----
+'Description: Deletes Folder
+'Usage: DeleteFolder
+'Output: True / False
+'Example: DeleteFolder "c:\temp\test"
+'-----------------------
+Function DeleteFolder(Folder)
+ On Error Resume Next
+ If FSO.FolderExists(Folder) Then
+ FSO.DeleteFolder Folder, True
+
+ If Err.Number = 70 Then
+ Err.Clear
+ FSO.GetFolder(Folder).Attributes = 0
+ FSO.DeleteFolder Folder, True
+ End If
+ If Err.Number = 0 Then
+ DeleteFolder = True
+ VbsLog "OK | Folder delete: [" & Folder & "]"
+ Else
+ DeleteFolder = False
+ ErrorHandling Err.Number, "Folder delete: (" & Err.Description & "): [" & Folder & "]"
+ End If
+ Else
+ DeleteFolder = False
+ VbsLog "Information | Folder delete (Folder don't exist): [" & Folder & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Delete Folder 2 -----
+'Description: Deletes Folder
+'Usage: DeleteFolder2 ,
+'Output: True / False
+'Example: DeleteFolder2 "C:\Temp\Testordner", "1,70"
+'---------------------------
+Function DeleteFolder2(Folder, AcceptedErrNr)
+ Dim ErrNr, i, TempErr, TempErrDesc
+ DeleteFolder2 = False
+ If FSO.FolderExists(Folder) Then
+ On Error Resume Next
+ FSO.DeleteFolder Folder, True
+ TempErr = Err.Number : TempErrDesc = Err.Description
+ On Error Goto 0
+
+ If TempErr = 0 Then
+ DeleteFolder2 = True
+ VbsLog "OK | Folder delete: [" & Folder & "]"
+ Else
+ ErrNr = Split(AcceptedErrNr, ",")
+ If UBound(ErrNr) >= 0 Then
+ For i = LBound(ErrNr) To UBound(ErrNr)
+ If CInt(ErrNr(i)) = CInt(TempErr) Then
+ VbsLog "Information | Folder delete accepted ExitCode (" & TempErr & "): (" & TempErrDesc & "): [" & Folder & "]"
+ Exit Function
+ End If
+ Next
+ End If
+ End If
+ ErrorHandling TempErr, "Folder delete: (" & TempErrDesc & "): [" & Folder & "]"
+ Else
+ VbsLog "Information | Folder delete (Folder don't exist): [" & Folder & "]"
+ End If
+End Function
+
+'----- Delete Registry -----
+'Description: Deletes Registry values, keys
+'Usage: DeleteReg , ,
+'Output: ErrorCode
+'Example: DeleteReg "KEY", "HKLM\Software\Testvalue", 64
+'Parameters: : KEY, VALUE
+'---------------------------
+Function DeleteReg (strRegType, key, hive)
+ Dim strRootKey, strKey, strValueName, objCtx, objLocator, objReg, intReturnCode, rootKey, keys, i, OPName
+
+ keys = Split(key,"\")
+ strRootKey = keys(0)
+ For i = 1 To UBound(keys)
+ strKey = strKey + keys(i) + "\"
+ Next
+ strValueName = keys(UBound(keys))
+
+ Select Case UCase(strRootKey)
+ Case "HKCR", "HKEY_CLASSES_ROOT"
+ rootKey = &h80000000
+ Case "HKCU", "HKEY_CURRENT_USER"
+ rootKey = &h80000001
+ Case "HKLM", "HKEY_LOCAL_MACHINE"
+ rootKey = &h80000002
+ Case "HKU", "HKEY_USERS"
+ rootKey = &h80000003
+ Case "HKCC", "HKEY_CURRENT_CONFIG"
+ rootKey = &h80000005
+ End Select
+
+ Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+ objCtx.Add "__ProviderArchitecture", hive
+ Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
+ Set objReg = objLocator.ConnectServer("", "root\default", "", "", , , , objCtx).Get("StdRegProv")
+
+ If UCase(strRegType) = "KEY" Then
+ OPName = "Delete Key"
+ Dim iRC,SubKeys,sKey
+ iRC = objReg.EnumKey (rootKey, strKey, SubKeys)
+
+ If iRC = 0 Then
+ If Not IsNull(SubKeys) Then
+ For Each sKey In SubKeys
+ DeleteReg "Key",strRootKey & "\" & strKey & sKey, hive
+ Next
+ End If
+ intReturnCode = objReg.DeleteKey (rootKey, strKey)
+ Else
+ intReturnCode = objReg.DeleteKey (rootKey, strKey)
+ End If
+ End If
+
+ If UCase(strRegType) = "VALUE" Then
+ OPName = "Delete Value"
+ strKey = Mid(key, Len(keys(0)) + 2, Len(key) - Len(keys(UBound(keys))) - Len(keys(0)) - 2)
+ strValueName = keys(UBound(keys))
+ intReturnCode = objReg.DeleteValue(rootKey,strKey,strValueName,"")
+ End If
+ DeleteReg = intReturnCode
+ If intReturnCode = 0 Then
+ VbsLog "OK | " & OPName & " [(" & hive & ") " & key & "]"
+ ElseIf intReturnCode = 2 Then
+ VbsLog "Information (" & intReturnCode & ") | " & OPName & ": Value not found [(" & hive & ") " & key & "]"
+ Else
+ ErrorHandling intReturnCode, OPName & ": [(" & hive & ") " & key & "]"
+ End If
+End Function
+
+'----- Delete Task -----
+'Description: Deletes a task
+'Usage: DeleteTask
+'Output: True / False
+'Example: DeleteTask "Testtask"
+'---------------------------
+Function DeleteTask(name)
+ On Error Resume Next
+ If Left(GetOSVersion(), 1) = "5" Then
+ ReDim arrTaskName(-1)
+ Dim oExec, x, i, output
+
+ Set oExec = WshShell.Exec("cmd /C schtasks.exe /Query /nh /fo csv")
+
+ Ret = 1
+ Do Until oExec.StdOut.AtEndOfStream
+ output = oExec.StdOut.ReadLine
+ If Len(output) > 1 And InStr(1, output, ",",1) <> 0 then
+ x = Split(output, ",")
+ ReDim preserve arrTaskName(Ubound(arrTaskName) + 1)
+ arrTaskName(UBound(arrTaskName)) = x(0)
+ End If
+ Loop
+
+ For i = LBound(Arrtaskname) To UBound(arrTaskName)
+ If LCase(Replace(arrTaskName(i),"""", "")) = LCase(name) Then
+ Ret = 0
+ End If
+ Next
+ Else
+ Ret = WSHShell.Run ("schtasks.exe /QUERY /TN """ & name & """", 0, True)
+ End If
+ VbsLog "TaskCommand = schtasks.exe /QUERY /TN """ & name & """ = "&Ret
+ If Ret <> 0 Then
+ VbsLog "Information | Delete Task (Task don't exist) [" & name & "]"
+ DeleteTask = False : Err.Clear
+ Exit Function
+ End If
+ Ret = WSHShell.Run ("schtasks.exe /Delete /TN """ & name & """ /f", 0, True)
+ If ret <> 0 Then
+ DeleteTask = False
+ ErrorHandling ret, "Task delete: [" & name & "]"
+ Else
+ DeleteTask = True
+ VbsLog "OK | Task delete: [" & name & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Delete Uninstall -----
+'Description: Deletes Uninstall in 32Bit-hive
+'Usage: DeleteUninstall("")
+'Example: DeleteUninstall "MySoftware"
+'----------------------------
+Function DeleteUninstall(Name)
+ If Name = "" Then Name = pName
+ DeleteReg "KEY","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name,32
+End Function
+
+
+'----- Delete Uninstall 64-----
+'Description: Deletes Uninstall in 64Bit-hive
+'Usage: DeleteUninstall64("")
+'Example: DeleteUninstall64 "MySoftware"
+'----------------------------
+Function DeleteUninstall64(Name)
+ If Name = "" Then Name = pName
+ DeleteReg "KEY","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name,64
+End Function
+
+
+'----- ErrorHandling -----
+' Function: ErrorHandling
+' Input: errorCode
+' Description: Collects error codes
+'**********************************************************************
+Sub ErrorHandling(errorCode,errorDescription)
+ If InStr(errorCode, "0") = 1 Then Exit Sub
+ If errorDescription = Empty Then ErrorDescription = ErrorText(errorCode)
+ VbsLog "ERROR (" & errorCode & ") | " & ErrorDescription
+ ReDim preserve errorList0(Ubound(errorList0) + 1)
+ errorList0(UBound(errorList0)) = errorCode
+End Sub
+
+
+'----- Error Text -----
+'Description: Returns Errortext
+'Usage: ErrorText
+'Example: ErrorName = ErrorText (3010)
+'---------------------------
+Function ErrorText(number)
+ If CheckFile("ErrorHandling.xml") Then
+ ErrorText = XMLErrordescription(number)
+ If ErrorText = "" Then ErrorText = ""
+ Else
+ Select Case number
+ Case "0" ErrorText="OK"
+ Case "1" ErrorText="Unspecific error occured"
+ Case "999" ErrorText="User info screen canceled by user."
+ Case "1601" ErrorText="The Windows Installer service could not be accessed."
+ Case "1603" ErrorText="Fatal error during installation."
+ Case "1605" ErrorText="This action is only valid for products that are currently installed."
+ Case "1618" ErrorText="Another installation is already in progress."
+ Case "1619" ErrorText="This installation package could not be opened."
+ Case "1624" ErrorText="Error applying transforms."
+ Case "1641" ErrorText="The installer has started a reboot."
+ Case "1642" ErrorText="The installer cannot install the upgrade patch because the program being upgraded may be missing, or the upgrade patch updates a different version of the program."
+ Case "3010" ErrorText="A restart is required to complete the install."
+ Case "5100" ErrorText="Restart required before installation can start."
+ Case "16005" ErrorText="Not by software-deployment installed and by Client Management I/FP-94 predetermined Version."
+ Case "16010" ErrorText="Audi Client not supported."
+ Case Else ErrorText=""
+ End Select
+ End If
+End Function
+
+'----- Finish Script -----
+'Description: Script-Finish-Wrapper
+'Usage: FinishScript()
+'Example: FinishScript()
+'---------------------------
+Function FinishScript()
+ Dim errorItem, failed, v, strFinish
+ failed = 0
+ VbsLog "======================================================="
+ For Each errorItem In errorList0
+ VbsLog "= ERROR: " & errorItem
+ If failed = 0 Then
+ failed = errorItem
+ Else
+ failed = 1
+ End If
+ Next
+
+ strFinish = "Installation"
+ If InStr(UCase(WScript.ScriptName),"UNINSTALL") > 0 Then
+ strFinish = "Deinstallation"
+ End If
+
+ If failed <> 0 Or Err <> 0 Then
+ VbsLog "= " & pName & " " & pVersion & " " & strFinish & " FAILED"
+ VbsLog "======================================================="
+ WScript.Quit(failed)
+ Else
+ VbsLog "= " & pName & " " & pVersion & " " & strFinish & " SUCCEEDED"
+ VbsLog "======================================================="
+ WScript.Quit(0)
+ End If
+End Function
+
+'----- FreeSpace Script -----
+'Description: Free Space on Drive
+'Usage: FreeSpace
+'Example: FreeSpace "c:"
+'Returns: Free space in MB
+'---------------------------
+Function FreeSpace(drv)
+ Dim drive,fso
+ Set fso = CreateObject("Scripting.FileSystemObject")
+ Set drive = fso.GetDrive(drv)
+ FreeSpace = Round(drive.FreeSpace/1024/1024)
+End Function
+
+'----- Get Client Version -----
+'Description: Returns the Audi-Client-Version
+'Usage: GetClientVersion()
+'Output: ClientVersion
+'Example: ClientVersion = GetClientVersion()
+'------------------------------
+Function GetClientVersion()
+ Dim clientVersion : clientVersion = "unknown"
+
+ If GetOSBit() = 64 And Left(GetOSVersion(), 3) = "6.3" Then
+ clientVersion = "AC3-Alpha"
+ GetClientVersion = clientVersion
+ Exit Function
+ End If
+
+ If ACVER = Empty Then
+ GetClientVersion = "unknown"
+ Exit Function
+ End If
+
+ Select Case Mid(ACVER, 3, 2)
+ Case 99 : clientVersion = "ASAP6.X"
+ Case 98 : clientVersion = "ASAP7.X"
+ Case 97 : clientVersion = "i.Do1.X"
+ Case 96 : clientVersion = "C-i.Do.1.X 32 Bit"
+ Case 95 : clientVersion = "C-i.Do.1.X 64 Bit"
+ Case 94 : clientVersion = "AC1-32-O"
+ Case 93 : clientVersion = "MED-V auf Basis AC-B-32-N"
+
+ Case 11 : clientVersion = "AC4-64-N"
+ Case 10 : clientVersion = "AC4-64-O"
+
+ Case 06 : clientVersion = "AC-B-32-N"
+ Case 05 : clientVersion = "AC-B-32-O"
+ Case 04 : clientVersion = "AC2-64-N"
+ Case 03 : clientVersion = "AC2-64-O"
+ Case 02 : clientVersion = "AC2-32-N"
+ Case 01 : clientVersion = "AC2-32-O"
+ case else : clientVersion = "unknown"
+ End Select
+
+ GetClientVersion = clientVersion
+End Function
+
+'----- Get Current User -----
+'Description: Returns if the currently logged on user
+'Usage: GetCurrentUser()
+'Output: Domain\User
+'Example: CurrentUser = GetCurrentUser()
+'----------------------------
+Function GetCurrentUser()
+ Dim strComputer, objWMIService, colItems, objItem
+ Dim tempLastUseTime, tempSID
+ On Error Resume Next
+ strComputer = "."
+ GetCurrentUser = ""
+
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ GetCurrentUser = objItem.UserName
+ Next
+ On Error Goto 0
+End Function
+
+'----- Get Current User SID -----
+'Description: Returns the SID of the currently logged on user
+'Usage: GetCurrentUserSID()
+'Output: SID
+'Example: CurrentUserSID = GetCurrentUserSID()
+'--------------------------------
+Function GetCurrentUserSID()
+ Dim strComputer, objWMIService, colItems, objItem
+ Dim tempLastUseTime, tempSID
+ On Error Resume Next
+ strComputer = "."
+ GetCurrentUserSID = ""
+ tempSID = ""
+
+ ' Part 1 (1st Try)
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT * FROM Win32_UserProfile WHERE Loaded = 1 And Special = 0",,48)
+ For Each objItem In colItems
+ If Left(objItem.SID, 8) = "S-1-5-21" And Not Left(Right(objItem.SID, 4), 1) = "-" Then
+ If objItem.LastUseTime > tempLastUseTime Then
+ tempLastUseTime = objItem.LastUseTime
+ GetCurrentUserSID = objItem.SID
+ tempSID = objItem.SID
+ End If
+ End If
+ Next
+ Err.Clear
+
+ If Len(tempSID) > 0 Then
+ GetCurrentUserSID = tempSID
+ On Error Goto 0
+ Exit Function
+ End If
+
+ ' Part 2 (2nd Try)
+ Dim user, objAccount
+
+ Set colItems = objWMIService.ExecQuery("Select UserName from Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ user = Split(objItem.UserName, "\")
+ Next
+
+ If UBound(user) > 0 Then
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT * FROM Win32_UserAccount WHERE Name='" + user(1) + " And Domain='" + user(0) + "'",,48)
+
+ Set objAccount = objWMIService.Get("Win32_UserAccount.Name='" & user(1) & _
+ "',Domain='" & User(0) & "'")
+ tempSID = objAccount.SID
+
+ If Len(tempSID) > 0 Then
+ GetCurrentUserSID = tempSID
+ On Error Goto 0
+ Exit Function
+ End If
+ End If
+
+ ' Part 3 (3rd Try)
+ Dim oReg : Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
+ Dim subKey, arrSubKeys
+ oReg.EnumKey &H80000003, "", arrSubKeys
+
+ For Each subKey In arrSubKeys
+ If Left(subKey, 8) = "S-1-5-21" And InStr(subKey, "Classes") = 0 And Not Left(Right(subKey, 4), 1) = "-" Then
+ tempSID = subKey
+ End If
+ Next
+
+ GetCurrentUserSID = tempSID
+ On Error Goto 0
+End Function
+
+'----- Get File Version -----
+'Description: Determines the version of a file
+'Usage: GetFileVersion()
+'Output: FileVersion
+'Example: FileVersion = GetFileVersion "file.exe"
+'----------------------------
+Function GetFileVersion(file)
+ If Not FSO.FileExists(file) Then
+ VbsLog "Information | Version of File: " + file + " : NOT FOUND"
+ GetFileVersion = "0"
+ Exit Function
+ End If
+ GetFileVersion = FSO.GetFileVersion(file)
+ VbsLog "Version of File: " + file + " : " + GetFileVersion
+End Function
+
+'----- Get Hardware Info -----
+'Description: Reads Hardware Info
+'Usage: GetHardwareInfo(Type)
+'Output: Desired Value
+'Example: Manufacturer = GetHardwareInfo "Manufacturer"
+'----------------------------
+Function GetHardwareInfo(text)
+ Dim objWMIService,colItems,objItem
+ Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
+ For Each objItem In colItems
+ If UCase(text) = "MANUFACTURER" Then GetHardwareInfo = objItem.Manufacturer
+ If UCase(text) = "MODEL" Then GetHardwareInfo = objItem.Model
+ Next
+End Function
+
+'----- Get Language -----
+'Description: Determines the client language
+'Usage: GetLanguage()
+'Output: DE/HU/EN/FR/IT/ES
+'Example: Language = GetLanguage()
+'------------------------
+Function GetLanguage()
+ Dim langID
+ langId = GetRegKeyValue("REG_SZ", "HKLM\SYSTEM\CurrentControlSet\Control\Nls\Language\Default", GetOSBit())
+ Select Case UCase(Right(langId,2))
+ Case "0E"
+ GetLanguage = "HU"
+ Case "07"
+ GetLanguage = "DE"
+ Case "09"
+ GetLanguage = "EN"
+ Case "0C"
+ GetLanguage = "FR"
+ Case "10"
+ GetLanguage = "IT"
+ Case "0A"
+ GetLanguage = "ES"
+ Case Else
+ VbsLog "Error | Function: GetLanguage [Language unknown]"
+ GetLanguage = "unknown"
+ End Select
+End Function
+
+'----- Get Last Boot Time -----
+'Description: Returns boot date and time
+'Usage: GetLastBootTime()
+'Output: Boot date and time
+'Example: GetLastBootTime()
+'------------------------
+Function GetLastBootTime()
+ Dim objOperatingSystem, strComputer
+ Dim objSWbemDateTime, objWMIService, colOperatingSystems
+
+ Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime")
+
+ strComputer = "."
+
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
+ Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
+
+ For Each objOperatingSystem in colOperatingSystems
+ objSWbemDateTime.Value = objOperatingSystem.LastBootUpTime
+ GetLastBootTime = objSWbemDateTime.GetVarDate(True)
+ Next
+
+ Dim HoursSince,DaysSince,strOut
+ HoursSince = DateDiff("h",GetLastBootTime,Now())
+ If HoursSince>24 Then
+ DaysSince=Int(HoursSince/24)
+ strOut = DaysSince & "d " & HoursSince Mod 24 & "h"
+ Else
+ strOut = HoursSince & "h"
+ End If
+
+ GetLastBootTime = GetLastBootTime & " (" & strOut & ")"
+End Function
+
+'----- Get Location -----
+'Description: Determines the client location
+'Usage: GetLocation()
+'Output: IN/NE/GY/BX/SJ
+'Example: Location = GetLocation()
+'------------------------
+Function GetLocation()
+ Dim strComputername,oTSEnv,strSiteCode,oSMSClient
+
+ GetLocation = "unknown" 'default
+ strSiteCode = ""
+
+' Detecting Location
+ On Error Resume Next
+ Set oTSEnv = CreateObject("Microsoft.SMS.TSEnvironment")
+
+ If Err.Number = 0 Then
+' Determine SCCM site and computer name by OSD variables
+ strComputername = Ucase(oTSEnv("OSDComputerName"))
+ strSiteCode = Ucase(oTSEnv("_SMSTSSiteCode"))
+ Else
+ Err.Clear
+ Set oSMSClient = CreateObject("Microsoft.SMS.Client")
+ If Err.Number = 0 Then
+' Determine SCCM site by clients assigned site
+ strComputername = Computername
+ strSiteCode = UCase(oSMSClient.GetAssignedSite)
+ End If
+ Set oSMSClient = Nothing
+ End If
+ Set oTSEnv = Nothing
+ Err.Clear
+
+ If strSiteCode = Empty Then
+ Set oSMSClient = CreateObject("Microsoft.SMS.Client")
+ If Err.Number = 0 Then
+' Determine SCCM site by clients assigned site
+ strSiteCode = UCase(oSMSClient.GetAssignedSite)
+ Set oSMSClient = Nothing
+ End If
+ End If
+
+ On Error Goto 0
+
+' Determine SCCM site code
+ Select Case UCase(strSiteCode)
+ Case "IN0","IN1","INT","PI0","PI1","IA0","IA1"
+ GetLocation = "IN"
+ Case "NE0","NE1","NET","PN0","PN1"
+ GetLocation = "NE"
+ Case "GY0","GY1","PG0","PG1"
+ GetLocation = "GY"
+ Case "BX0","BX1","PB0","PB1"
+ GetLocation = "BX"
+ Case "PS0","SJ1","PJ1"
+ GetLocation = "SJ"
+ Case "PS1","SA1"
+ GetLocation = "SA"
+ Case Else
+' Determine Location by ACVER
+ If ACVER <> False Then
+ Select Case Mid(ACVer,9,1)
+ Case 1 : GetLocation = "GY" : Exit Function
+ Case 2 : GetLocation = "BX" : Exit Function
+ Case 3 : GetLocation = "SJ" : Exit Function
+ Case 4 : GetLocation = "SA" : Exit Function
+ End Select
+ Else
+ 'ACVER not found.
+ End If
+
+' Determine Location by Computername
+ Select Case UCase(Mid(strComputerName,5,2))
+ Case "IN"
+ GetLocation = "IN"
+ Case "NE"
+ GetLocation = "NE"
+ Case "BX"
+ GetLocation = "BX"
+ Case "GY"
+ GetLocation = "GY"
+ Case "SJ"
+ GetLocation = "SJ"
+ Case "SA"
+ GetLocation = "SA"
+ Case Else
+' Could not determine location. Location = unknown
+ End Select
+ End Select
+End Function
+
+'----- Get OS-Bit -----
+'Description: Returns the bitsystem
+'Usage: GetOSBit()
+'Output: 32 / 64
+'Example: OSBit = GetOSBit()
+'--------------------
+Function GetOSBit()
+ Dim strComputer, objWMIService, objItem, colItems
+
+ strComputer = "."
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT SystemType FROM Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ If (objItem.SystemType = "x64-based PC") Then
+ GetOSBit = 64
+ Else
+ GetOSBit = 32
+ End If
+ Next
+End Function
+
+'----- Get OS-Version -----
+'Description: Returns the Windows-OS-Version
+'Usage: GetOSVersion()
+'Output: OS Version
+'Example: OSVersion = GetOSVersion()
+'------------------------
+Function GetOSVersion()
+ Dim strComputer, objWMIService, objItem, colItems
+
+ strComputer = "."
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT Version FROM Win32_OperatingSystem",,48)
+ For Each objItem In colItems
+ GetOSVersion = objItem.Version
+ Next
+End Function
+
+'----- Check for Pending Reboots -----
+'Description: Returns the status of pending reboots
+'Usage: GetRebootStatus()
+'Output: Reboot source / False
+'Example: GetRebootStatus()
+'------------------------
+Function GetRebootStatus()
+ Dim sRebootNeeded, localdummy, localPFROarr, localErg, iHive
+ Dim objWMIService, colItems, objItem
+ Dim objWUSysInfo, objRegint, objAgentInfo
+ Dim oCtx, oLocator
+ Const HKEY_LOCAL_MACHINE = &H80000002
+ sRebootNeeded = False
+
+ Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT SystemType FROM Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ If (objItem.SystemType = "x64-based PC") Then
+ iHive = 64
+ Else
+ iHive = 32
+ End If
+ Next
+
+ 'VbsLog "Information | Checking Windows Update..."
+ Set objWUSysInfo = CreateObject("Microsoft.Update.SystemInfo")
+ If objWUSysInfo.RebootRequired Then
+ sRebootNeeded = "Windows Update"
+ End If
+ Set objWUSysInfo = Nothing
+
+ Set oCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+ oCtx.Add "__ProviderArchitecture", iHive
+ Set oLocator = CreateObject("Wbemscripting.SWbemLocator")
+
+ 'VbsLog "Information | Checking Component Based Servicing (CBS)..."
+ Set objRegint = oLocator.ConnectServer("", "root\default", "", "", , , , oCtx).Get("StdRegProv")
+ localErg = objRegint.EnumKey(HKEY_LOCAL_MACHINE,"Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending", localdummy)
+ If (localErg = 0) And (Err.Number = 0) Then
+ If sRebootNeeded <> False Then
+ sRebootNeeded = sRebootNeeded & " | Component Based Servicing"
+ Else
+ sRebootNeeded = "Component Based Servicing"
+ End If
+ End If
+ Set objRegInt = Nothing
+
+ 'VbsLog "Information | Checking Pending File Rename Operations..."
+ Set objRegint = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
+ LocalErg = objRegInt.GetMultiStringValue(HKEY_LOCAL_MACHINE,"SYSTEM\CurrentControlSet\Control\Session Manager","PendingFileRenameOperations", localPFROarr)
+ If (LocalErg = 0) And (Err.Number = 0) Then
+ If sRebootNeeded <> False Then
+ sRebootNeeded = sRebootNeeded & " | PendingFileRenameOperations"
+ Else
+ sRebootNeeded = "PendingFileRenameOperations"
+ End If
+ End If
+ Set objRegInt = Nothing
+
+ If sRebootNeeded = False Then sRebootNeeded = "No"
+ GetRebootStatus = sRebootNeeded
+End Function
+
+'----- Get RegKey-Value -----
+'Description: Determines the value of a RegValue
+'Usage: GetRegKeyValue , ,
+'Output: Value
+'Example: Value = GetRegKeyValue ("REG_SZ", "HKLM\Software\AudiAG\MeinTest\MeinKey", 32)
+'Parameters: : REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ, REG_DWORD, REG_QWORD, REG_BINARY
+' : 32, 64
+'----------------------------
+Function GetRegKeyValue(keyType, key, hive)
+ Dim oCtx, oLocator, oReg, oInParams, oOutParams
+ Dim hk, r, i, path, operation
+ Dim strValue, strTemp
+
+ Set oCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+
+ If (hive = 32 Or hive = 64) Then oCtx.Add "__ProviderArchitecture", hive
+
+ Set oLocator = CreateObject("Wbemscripting.SWbemLocator")
+ Set oReg = oLocator.ConnectServer("", "root\default", "", "", , , , oCtx).Get("StdRegProv")
+
+ r = Split(key, "\")
+ r(0) = UCase(r(0))
+ If r(0) = "HKEY_CLASSES_ROOT" Or r(0) = "HKCR" Then
+ hk = &H80000000
+ ElseIf r(0) = "HKEY_CURRENT_USER" Or r(0) = "HKCU" Then
+ hk = &H80000001
+ ElseIf r(0) = "HKEY_LOCAL_MACHINE" Or r(0) = "HKLM" Then
+ hk = &H80000002
+ ElseIf r(0) = "HKEY_USERS" Or r(0) = "HKU" Then
+ hk = &H80000003
+ End If
+
+ path = Mid(key, Len(r(0)) + 2, Len(key) - Len(r(UBound(r))) - Len(r(0)) - 2)
+
+ If Left(UCase(keyType),4) <> "REG_" Then keyType = "REG_" + keyType
+ Select Case UCase(keyType)
+ Case "REG_SZ" : operation = "GetStringValue"
+ Case "REG_EXPAND_SZ" : operation = "GetExpandedStringValue"
+ Case "REG_MULTI_SZ" : operation = "GetMultiStringValue"
+ Case "REG_DWORD" : operation = "GetDWORDValue"
+ Case "REG_QWORD" : operation = "GetQWORDValue"
+ Case "REG_BINARY" : operation = "GetBinaryValue"
+ case Else : ErrorHandling 16000, "Function GetRegKeyValue: Unknown keytype"
+ End Select
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+
+ Select Case UCase(keyType)
+ Case "REG_SZ", "REG_EXPAND_SZ"
+ GetRegKeyValue = oOutParams.sValue
+ Case "REG_MULTI_SZ"
+ If Not IsNull(oOutParams.sValue) Then GetRegKeyValue = Join(oOutParams.sValue, "|")
+ Case "REG_BINARY"
+ For Each strValue in oOutParams.uvalue
+ If len (Hex(strValue)) < 2 Then
+ strValue = "0" & Hex(strValue)
+ Else
+ strValue = Hex(strValue)
+ End If
+ strTemp = strTemp & strValue & "|"
+ Next
+ If Right(strTemp, 1) = "|" Then strTemp = Left(strTemp, Len(strTemp) - 1)
+ GetRegKeyValue = strTemp
+ Case "REG_DWORD", "REG_QWORD"
+ GetRegKeyValue = oOutParams.uValue
+ End Select
+End Function
+
+'----- Get SCCMSiteCode -----
+'Description: Show the SCCM-Site-Code
+'Usage: GetSCCMSiteCode()
+'Output: SiteCode or "unknown"
+'----------------------------
+Function GetSCCMSiteCode()
+ On Error Resume Next
+ Dim oClient
+ Set oClient = CreateObject("Microsoft.SMS.Client")
+ If Err.Number <> 0 then
+ VbsLog "ERROR | Could not create SMS Client Object."
+ GetSCCMSiteCode = "unknown"
+ Else
+ GetSCCMSiteCode = UCase(oClient.GetAssignedSite)
+ End if
+ On Error Goto 0
+End Function
+
+'----- GetScriptArchitecture() -----
+' Description: Returns the script is run as 32 or 64Bit
+' Input: n/a
+' Output: 32 / 64 / unknown
+' Example: GetScriptArchitecture()
+' Author(s): AL
+' Last Edit: 02.05.2014
+'----------------------------
+Function GetScriptArchitecture()
+ Dim objFSO, WSHShell, EnvProc
+ Set objFSO = WScript.CreateObject("Scripting.Filesystemobject")
+ Set WshShell = WScript.CreateObject("WScript.Shell")
+ Set EnvProc = WSHShell.Environment("PROCESS")
+
+ Dim strComputer, objWMIService, objItem, colItems, iOS
+
+ strComputer = "."
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery("SELECT SystemType FROM Win32_ComputerSystem",,48)
+ For Each objItem in colItems
+ If (objItem.SystemType = "x64-based PC") Then
+ iOS = 64
+ Else
+ iOS = 32
+ End If
+ Next
+ If iOS = 64 Then
+ If objFSO.FolderExists(EnvProc("winDir")) Then
+ If objFSO.FolderExists(EnvProc("winDir") & "\Sysnative") Then
+ GetScriptArchitecture = 32
+ Else
+ GetScriptArchitecture = 64
+ End If
+ Else
+ GetScriptArchitecture = "unknown"
+ End If
+ Else
+ GetScriptArchitecture = 32
+ End If
+End Function
+
+'----- Get Userlanguage -----
+'Description: Show the Userlanguage
+'Usage: GetUserLanguage()
+'Output: "DE", "HU", "EN", "FR", "ES", "IT", "unknown"
+'----------------------------
+Function GetUserLanguage()
+ If Left(GetOSVersion(),1) < 6 Then
+ Dim strTempLanguage
+ strTempLanguage = GetRegKeyValue("REG_SZ", "HKCU\Control Panel\Desktop\MUILanguagePending", 32)
+ If IsNull(strTempLanguage) Then
+ VbsLog "Information: RegKey not found 'HKCU\Control Panel\Desktop\MUILanguagePending'. Userlanguage is Clientlanguage"
+ strTempLanguage = GetLanguage()
+ End If
+ Select Case strTempLanguage
+ Case "00000407", "DE" 'Deutsch
+ GetUserLanguage = "DE"
+ Case "0000040e", "HU" 'Ungarisch
+ GetUserLanguage = "HU"
+ Case "00000409", "EN" 'Englisch
+ GetUserLanguage = "EN"
+ Case "0000040c", "FR" 'Franzsisch
+ GetUserLanguage = "FR"
+ Case "00000c0a", "ES" 'Spanisch
+ GetUserLanguage = "ES"
+ Case "00000410", "IT" 'Italienisch
+ GetUserLanguage = "IT"
+ Case Else
+ GetUserLanguage = "unknown"
+ End Select
+ Else
+ Select Case LCase(GetRegKeyValue("REG_MULTI_SZ", "HKCU\Control Panel\Desktop\PreferredUILanguages", 32))
+ Case "de-de"
+ GetUserLanguage = "DE"
+ Case "hu-hu"
+ GetUserLanguage = "HU"
+ Case "us-us", "en-us"
+ GetUserLanguage = "EN"
+ Case "fr-fr"
+ GetUserLanguage = "FR"
+ Case "es-es"
+ GetUserLanguage = "ES"
+ Case "it-it"
+ GetUserLanguage = "IT"
+ Case Else
+ GetUserLanguage = "unknown"
+ End Select
+ End If
+ VbsLog "Userlanguage: " & GetUserLanguage
+End Function
+
+'----- Infoblende -----
+'Description: Shows InfoPanel when no tasksequence is running
+'Usage: InfoBlende "xmlfile.xml"
+'Example: InfoBlende "" or InfoBlende "info.xml"
+'Returns: True if panel was shown, False if not
+'------------------------------
+Function InfoBlende(XML)
+ If CheckProc("TsBootShell.exe,TsmBootstrap.exe,TSManager.exe,TSProgressUI.exe,SMSBoot.exe") = True Then
+ VbsLog "Information | OSD-Installation or tasksequence is running. Panel skipped."
+ InfoBlende = False
+ Exit Function
+ End If
+
+ If XML = "" Then
+ run "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe","0"
+ Else
+ run "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe """ & XML & """","0"
+ End If
+
+ InfoBlende = True
+End Function
+
+'----- Infoblendenowait -----
+'Description: Shows InfoPanel when no tasksequence is running
+'Usage: Infoblendenowait "xmlfile.xml"
+'Example: Infoblendenowait "" or Infoblendenowait "info.xml"
+'Returns: True if panel was shown, False if not
+'------------------------------
+Function InfoBlendeNoWait(XML)
+ If CheckProc("TsBootShell.exe,TsmBootstrap.exe,TSManager.exe,TSProgressUI.exe,SMSBoot.exe") = True Then
+ VbsLog "Information | OSD-Installation or tasksequence is running. Panel skipped."
+ InfoBlendeNoWait = False
+ Exit Function
+ End If
+
+ If XML = "" Then
+ RunNoWait "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe"
+ Else
+ RunNoWait "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe """ & XML & """"
+ End If
+
+ InfoBlendeNoWait = True
+End Function
+
+'----- InstallCertificate -----
+'Description: Install certificates from folder "CertificateFolder"
+'Usage: InstallCertificate , ,
+'Example: InstallCertificate "C:\...\Certificates", "TrustedPublisher", False
+'Parameter: : "Root", "TrustedPublisher"
+'------------------------------
+Sub InstallCertificate(CertificateFolder, StoreLocation, IncludeSubFolders)
+ Dim colFiles, objFile, objFolder
+
+ 'Prft, ob die Datei "CertMgr.exe" im Ordner oder Unterorder enthalten ist
+ 'Wenn diese nicht vorhanden ist, wird das Script beendet
+ Dim objWSH_Exec, outLine, strCertMgr
+ Const WSHRunning = &H0
+
+ strCertMgr = False
+ Set objWSH_Exec = WSHShell.Exec ("cmd.exe /c dir """ & currentDir & """ /s /b")
+ 'Wait for shell to be terminated
+ With objWSH_Exec
+ Do While Not objWSH_Exec.StdOut.AtEndOfStream
+ outLine = Trim(objWSH_Exec.StdOut.ReadLine)
+ If InStr(1, LCase(outLine), LCase("CertMgr.Exe"),0) Then
+ strCertMgr = outLine
+ End If
+ Loop
+ End With
+ If strCertMgr = False Then
+ ErrorHandling 1627, "InstallCertificate: CertMgr.exe ist not in the package"
+ FinishScript()
+ End If
+
+ Set objFolder = FSO.GetFolder(CertificateFolder)
+
+ Set colFiles = objFolder.Files
+ For Each objFile In colFiles
+ Select Case LCase(Right(objFile.Name,4))
+ Case ".cer"
+ run "Install Certificate","""" & strCertMgr & """ -add """ & objFile.Path & """ -s -r localMachine " & StoreLocation, ""
+ Case ".p7b"
+ run "Install Certificate","""" & strCertMgr & """ -add -all """ & objFile.Path & """ -s -r localMachine " & StoreLocation, ""
+ End Select
+ Next
+
+ If IncludeSubfolders = True Then
+ Dim SubFolder
+ For Each SubFolder In objFolder.SubFolders
+ InstallCertificate SubFolder, StoreLocation, True
+ Next
+ End If
+End Sub
+
+'----- InstallDrivers -----
+'Description: Install all drivers in "DriversPath" Folder
+'Usage: InstallDrivers ,
+'Example: InstallDrivers "c:\...\Drivers", True
+'--------------------------
+Sub InstallDrivers(DriversPath, IncludeSubfolders)
+ Dim colFiles, objFile, objFolder, SubFolder, strDevconExe
+ Dim objWSH_Exec, outLine
+ Const WSHRunning = &H0
+
+ If Not Right(DriversPath, 1) = "\" Then DriversPath = DriversPath & "\"
+
+ Set objFolder = FSO.GetFolder(DriversPath)
+ Set colFiles = objFolder.Files
+
+ 'Find Devcon (only XP)
+ If Left(GetOSVersion(),1) = "5" Then
+ If Not(InStr(IncludeSubFolders, Currentdir)) And IncludeSubfolders = True Or IncludeSubfolders = False Then
+ Set objWSH_Exec = WSHShell.Exec ("cmd.exe /c dir """ & currentDir & """ /s /b")
+ 'Wait for shell to be terminated
+ With objWSH_Exec
+ Do While Not objWSH_Exec.StdOut.AtEndOfStream
+ outLine = Trim(objWSH_Exec.StdOut.ReadLine)
+ If InStr(1, LCase(outLine), LCase("devcon.exe"),0) Or InStr(1, LCase(outLine), LCase("devcon_" & GetOSBit() & ".exe"),0) Then
+ strDevconExe = outLine
+ End If
+ Loop
+ End With
+ Else
+ strDevconExe = IncludeSubfolders
+ End If
+ If strDevconExe = "" Then
+ ErrorHandling 1627, "InstallDrivers: ERROR: Devcon.exe ist not in the package"
+ FinishScript()
+ End If
+
+ If Not IncludeSubfolders = False Then
+ IncludeSubfolders = strDevconExe
+ End If
+ End If
+
+ For Each objFile In colFiles
+ If LCase(Right(objFile.Name, 4)) = ".inf" Then
+ Select Case Left(GetOSVersion(), 2)
+ Case "5."
+ If strDevconExe = False Or strDevconExe = "" Then
+ ErrorHandling 1627, "InstallDrivers: Devcon.exe ist not in the package"
+ FinishScript()
+ End If
+
+ If Not IncludeSubfolders = False Then
+ IncludeSubfolders = strDevconExe
+ End If
+ run "Driver","""" & strDevconExe & """ dp_add """ & objFile.Path & """", "0,1"
+ Case "6."
+ If GetOSBit() = 32 Then
+ run "Driver","pnputil.exe -i -a """ & objFile.Path & """", "0,259"
+ Else
+ 'OperatingSystem x64 > XP
+ If FSO.FileExists(WinDir & "\System32\pnputil.exe") Then
+ run "Driver","""" & WinDir & "\System32\pnputil.exe"" -i -a """ & objFile.Path & """", "0,259"
+ Else
+ run "Driver","""" & WinDir & "\sysnative\pnputil.exe"" -i -a """ & objFile.Path & """", "0,259"
+ End If
+ End If
+ Case "10"
+ If FSO.FileExists(WinDir & "\System32\pnputil.exe") Then
+ run "Driver","""" & WinDir & "\System32\pnputil.exe"" -i -a """ & objFile.Path & """", "0,259"
+ Else
+ run "Driver","""" & WinDir & "\sysnative\pnputil.exe"" -i -a """ & objFile.Path & """", "0,259"
+ End If
+ End Select
+ End If
+ Next
+
+ 'Install Drivers from Subfolders if "IncludeSubfolders = True"
+ If Not IncludeSubfolders = False Then
+ Set objFolder = FSO.GetFolder(DriversPath)
+ For Each SubFolder In objFolder.SubFolders
+ InstallDrivers SubFolder.Path, IncludeSubfolders
+ Next
+ End If
+End Sub
+
+'----- Kill Process(es) -----
+'Description: Kills Processes
+'Usage: KillProc
+'Example: KillProc "outlook.exe,word.exe"
+'----------------------------
+Sub KillProc(proc)
+ Dim colProcess,objProcess,objWMIService,v,i,colProcess2
+ Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
+ v=Split(proc,",")
+ For i = 0 To UBound(v)
+ v(i) = Trim(v(i))
+ Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = '" & v(i) & "'")
+ If colProcess.Count = 0 Then vbslog "Information | Prozess [" & v(i) & "] nicht aktiv!"
+ For Each objProcess In colProcess
+ On Error Resume Next
+ Ret = objProcess.Terminate()
+ On Error Goto 0
+ WScript.Sleep (2000)
+ If Ret = 0 Then
+ vbslog "OK | Process [" & v(i) & "] successfull killed"
+ Else
+ ErrorHandling 1, "Process [" & v(i) & "] could not be killed"
+ End If
+ Ret = empty
+ Next
+ Next
+End Sub
+
+'----- PanelWait -----
+'Description: Repeats Info Panel x times until Process ist closed
+'Usage: PanelWait , ,
+'Output: TRUE if Process was closed, FALSE if Process is still running
+'Example: PanelWait "notepad.exe",300,3
+'---------------------
+Function PanelWait(process,timewait,rep)
+ Dim Count : Count = 0
+
+ VbsLog "---------- Execute PanelWait Function: '" & process & "' '" & timewait & "' '" & rep & "'"
+ PanelWait = True
+ If CheckProc("TsBootShell.exe,TsmBootstrap.exe,TSManager.exe,TSProgressUI.exe,SMSBoot.exe") = True Then
+ VbsLog "Information | OSD-Installation or tasksequence is running. Panel skipped."
+ Exit Function
+ End If
+
+ Do While (rep>0) And (CheckProc(process))
+ run "Blende SCCM","Infoblende\AudiSysWrapper.exe Infoblende.exe /w","0"
+ Do While (Count<(timewait/10)) And CheckProc(process) = True
+ WScript.Sleep(10000)
+ Count = Count + 1
+ Loop
+ rep = rep - 1
+ Count = 0
+ Loop
+ If CheckProc(process) = True Then PanelWait = False
+ VbsLog "---------- RESULT PanelWait: " & PanelWait
+End Function
+
+'----- PatchInstalled -----
+'Description: Check Hotfix or Security Update is installed
+'Usage: PatchInstalled
+'Output: True or False
+'Example: PatchInstalled "KB2510636"
+'-------------------------
+Function PatchInstalled(Patch)
+ On Error Resume Next
+ Dim objSession, objSearcher, intHistorycount, colHistory, objEntry, HotFixKB
+
+ Set objSession = CreateObject("Microsoft.Update.Session")
+ Set objSearcher = objSession.CreateUpdateSearcher
+ intHistoryCount = objSearcher.GetTotalHistoryCount
+
+ Set colHistory = objSearcher.QueryHistory(0, intHistoryCount)
+ If Err.Number <> 0 Then
+ VbsLog "Error (" & Err.Number & ") | Function: Patchinstalled (" & Patch & ")"
+ On Error Goto 0
+ Exit Function
+ End If
+ On Error Goto 0
+
+ For Each objEntry in colHistory
+ If InStr(1, objEntry.Title, "(KB", 1) And objEntry.ResultCode = 2 Then
+ HotFixKB = Mid(objEntry.Title, InStr(1,objEntry.Title, "(KB", 1)+1)
+ HotFixKB = Left(HotFixKB, InStr(HotFixKB, ")")-1)
+ If UCase(Patch) = UCase(HotFixKB) Then
+ PatchInstalled = True
+ VbsLog "Information: Patch installed (" & Patch & ")"
+ Exit Function
+ End If
+ End If
+ Next
+ PatchInstalled = False
+ VbsLog "Information: Patch not installed (" & Patch & ")"
+End Function
+
+'----- Reads Environment Variable -----
+'Description: Reads Environment Variable
+'Usage: ReadEnv
+'Example: ret = ReadEnv "WINDIR"
+' FALSE if not readable
+'---------------------------------
+Function ReadEnv(Environ)
+ ReadEnv=WSHShell.ExpandEnvironmentStrings("%" & environ & "%")
+ If Left(ReadEnv,1)="%" Then ReadEnv = False
+End Function
+
+'----- Set/Create, Add to, Modify and Delete Environment Variable -----
+'Description: Set Environment Variable
+'Usage: SetEnv , ,
+'Parameter for Operation: SET, ADD, DEL, DELV
+'Example: SetEnv "PATH","c:\temp","ADD"
+'--------------------------------------------------------------
+Function SetEnv(Environment,Value,Operation)
+ Dim EnvironmentPath, EnvironmentData, NewValue, Env, DelValue, oEnv, oShell
+ EnvironmentPath = "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\" & Environment
+ EnvironmentData = GetRegKeyValue( "SZ","HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\" & Environment, GetOSBit())
+
+ If UCase(Operation) = "DEL" Then
+ If Not IsNull(EnvironmentData) Then
+ DeleteReg "VALUE",EnvironmentPath,GetOSBit()
+ Else
+ VbsLog "Information | Delete Environment '" & Environment & "': Was not set."
+ End If
+ ElseIf UCase(Operation) = "DELV" Then
+ 'Environment vorhanden
+ Set oShell = WScript.CreateObject("WScript.Shell")
+ Set oEnv = oShell.Environment("SYSTEM")
+ Env = oEnv(Environment)
+ DelValue =";" & Value
+ NewValue = Replace(Env,DelValue,"")
+ oEnv(Environment) = NewValue
+ VbsLog "OK | '" & Value & "' was removed from '" & Environment & "'"
+ ElseIf IsNull(EnvironmentData) Or UCase(Operation) = "SET" Then
+ 'Environment nicht vorhanden
+ VbsLog "OK | Set Environment: '" & Environment & "' to '" & Value & "'"
+ WriteReg "SZ",EnvironmentPath,Value,GetOSBit()
+ ElseIf UCase(Operation) = "ADD" Then
+ 'Environment vorhanden
+ Dim i, x
+ i = Split(Replace(EnvironmentData,";;",";"), ";")
+ For x = LBound(i) To UBound(i)
+ If UCase(i(x)) = UCase(Value) Then
+ VbsLog "Information | Value '" & Value & "' is already in Environment '" & Environment & "'"
+ Exit Function
+ End If
+ Next
+ If Right(EnvironmentData, 1) = ";" Then
+ WriteReg "SZ",EnvironmentPath,EnvironmentData & Value, GetOSBit()
+ Else
+ WriteReg "SZ",EnvironmentPath,EnvironmentData & ";" & Value, GetOSBit()
+ End If
+ VbsLog "OK | Added '" & Value & "' to '" & Environment & "'"
+ End If
+End Function
+
+'----- Run Commandline -----
+'Description: Executes a Commandline
+'Usage: run , ,
+'Example: run "Install","msiexec.exe /i prog.msi","0,3010"
+'----------------
+Function Run(Text,Line,Abbruch)
+ Dim ErrCount, ErrOK, I
+ VbsLog "Execute Run Function: '" & Text & "' '" & Line & "' '" & Abbruch & "'"
+ On Error Resume Next
+ Ret = WSHShell.Run (Line, 0, True)
+
+ WSHShell.CurrentDirectory = InstallDir
+
+ ErrOK = False
+ If Abbruch = "" Or Abbruch = False Then ErrOK = True
+ If Text = "" Then Text = "Run"
+ If Ret = Empty Then Ret = Err.Number
+
+ If Ret = 0 Then
+ VbsLog "+ RESULT Run " & Text & ": OK"
+ Else
+ ErrCount = Split(Replace(Abbruch, " ", ""),",")
+ If UBound(ErrCount) >=0 Then
+ For I = LBound(ErrCount) To UBound(ErrCount)
+ If StrComp(ErrCount(I), Ret) = 0 Then
+ VbsLog "+ RESULT Run " & Text & ": OK | Accepted ExitCode (" & Ret & ", " & ErrorText(Ret) & ")"
+ run = Ret
+ On Error Goto 0
+ Exit Function
+ End If
+ Next
+ End If
+
+ If ErrOK = True Then
+ VbsLog "+ RESULT Run " & Text & ": OK | Accepting all ExitCodes"
+ run = Ret
+ On Error Goto 0
+ Exit Function
+ Else
+ ErrorHandling Ret, "+ RESULT Run " & Text & ": ERROR (" & Ret & ", " & ErrorText(Ret) & ")"
+ FinishScript()
+ End If
+ End If
+ On Error Goto 0
+End Function
+
+'----- Run Commandline no wait -----
+'Description: Executes a Commandline without waiting for completion
+'Usage: run ,
+'Example: run "Install","msiexec.exe /i prog.msi"
+'-----------------------------------
+Sub RunNoWait(Text,Line)
+ Dim ErrText, ErrCount, I
+
+ VbsLog "Execute RunNoWait Function: '" & Line & "'"
+
+ On Error Resume Next
+ WSHShell.Run Line, 0, False
+ WSHShell.CurrentDirectory = InstallDir
+
+ If Text = "" Then Text = "Started"
+
+ VbsLog Text & ": " & Line
+
+ On Error Goto 0
+End Sub
+
+'----- Uninstall Product -----
+'Description: Uninstall application with if installed
+'Usage: UninstallProduct ,
+'Output Returncode of uninstall if product ist deinstalled, False if product was not installed
+'Example: UninstallProduct "Apple QuickTime","{B332732A-4958-41DD-B439-DDA2D32753C5}"
+'-----------------------------
+Function UninstallProduct(Name,ProductCode)
+ Dim objInstaller, UninstallLogName
+
+ Const msiInstallStateUnknown = -1 'The product is neither advertised or installed.
+ Set objInstaller = WScript.CreateObject("WindowsInstaller.Installer")
+ If objInstaller.ProductState(ProductCode) <> msiInstallStateUnknown Then
+ VbsLog "Uninstall " & Name & ": " & ProductCode
+ VbsLog "+ ProductName: " & objInstaller.ProductInfo(ProductCode, "ProductName")
+ VbsLog "+ Version: " & objInstaller.ProductInfo(ProductCode, "VersionString")
+ VbsLog "+ Publisher: " & objInstaller.ProductInfo(ProductCode, "Publisher")
+ UninstallLogName = LogDir & pName & "_" & pVersion & "_" & pLang & "_" & pRevision & "_msi-uninstall.log"
+ run "Uninstall","msiexec.exe /x " & ProductCode & " /qn /norestart /lvoicewarmup+ """ & UninstallLogName & """", "0,1605,3010"
+ UninstallProduct = True
+ Else
+ VbsLog "Information | Uninstall Function:" & Name & " is not installed " & ProductCode
+ UninstallProduct = False
+ End If
+End Function
+
+'----- Unzip File -----
+'Description: Unzip a compressed file
+'Usage: UnzipFile ,
+'Output Returncode of Unzip
+'Example: UnzipFile "test.zip","c:\temp"
+'-----------------------------
+Function UnzipFile(ZipFilePath, DestFolder)
+ Dim strCommand
+
+ strCommand = "7za.exe x -y -o""" & DestFolder & """ """ & ZipFilePath & """"
+
+ VbsLog "Unzip File: " & ZipFilePath
+ VbsLog "+Run: " & strCommand
+ UnzipFile = wshshell.run (strCommand, 0, True)
+ If UnzipFile <> 0 Then
+ Errorhandling UnzipFile, "Failed to extract file :'" & ZipFilePath & "' | Output directory: " & DestFolder
+ FinishScript()
+ Else
+ VbsLog "+OK | File extract :'" & ZipFilePath & "' | Output directory: " & DestFolder
+ End If
+End Function
+
+'----- Write VBSLog -----
+'Description: Writes Line into logfile
+'Usage: VbsLog
+'Example: VbsLog "This is Text"
+'-----------------------------
+Sub VbsLog(LogText)
+ If DebugMode = True Then WScript.Echo (Now & "|" & LogText)
+ If LogEnabled = False Then Exit Sub
+
+ Dim fso, WSHShell, LogFile, pointer, newFolder
+ Set fso = CreateObject("Scripting.FileSystemObject")
+ Set WSHShell = CreateObject("WScript.Shell")
+ '----- Verzeichnis anlegen falls es nicht existiert
+ If fso.FolderExists(LogDir) = False Then
+ CreateFolder(LogDir)
+ End If
+
+ Set LogFile = FSO.OpenTextFile(LogName, 8, True, -1)
+ LogFile.WriteLine Now & "|" & LogText
+ LogFile.Close
+End Sub
+
+'----- Write Registry -----
+'Description: Writes Registry values, keys
+'Usage: WriteReg , , ,
+'Output: Errorcode if failed, True if successfull
+'Example: WriteReg "REG_SZ", "HKLM\Software\Testvalue", "Text", 64
+'Parameters: : REG_SZ, REG_DWORD, REG_BINARY, REG_EXPAND_SZ, REG_MULTI_SZ
+' : 32, 64
+'-------------------------
+Function WriteReg(KeyType, key, value, hive)
+ Dim oCtx, oLocator, oReg, oInParams, oOutParams
+ Dim hk, r, i, path, operation
+ Dim strTemp
+
+ If IsArray(Value) Then
+ VbsLog "Execute WriteReg Function: '" & KeyType & "' '" & Key & "' '" & Join(Value,"|") & "' '" & Hive & "'"
+ Else
+ VbsLog "Execute WriteReg Function: '" & KeyType & "' '" & Key & "' '" & Value & "' '" & Hive & "'"
+ End If
+
+ Set oCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+
+ If (hive = 32 Or hive = 64) Then
+ oCtx.Add "__ProviderArchitecture", hive
+ Else
+ ErrorHandling 2, "WriteReg: Wrong Parameter (Hive)"
+ Exit Function
+ End If
+
+ Set oLocator = CreateObject("Wbemscripting.SWbemLocator")
+ Set oReg = oLocator.ConnectServer("", "root\default", "", "", , , , oCtx).Get("StdRegProv")
+
+ r = Split(key, "\")
+ r(0) = UCase(r(0))
+ If r(0) = "HKEY_CLASSES_ROOT" Or r(0) = "HKCR" Then
+ hk = &H80000000
+ ElseIf r(0) = "HKEY_CURRENT_USER" Or r(0) = "HKCU" Then
+ hk = &H80000001
+ ElseIf r(0) = "HKEY_LOCAL_MACHINE" Or r(0) = "HKLM" Then
+ hk = &H80000002
+ ElseIf r(0) = "HKEY_USERS" Or r(0) = "HKU" Then
+ hk = &H80000003
+ End If
+
+ For i = 1 To UBound(r)-1
+ path = path & r(i) & "\"
+ Set oInParams = oReg.Methods_("CreateKey").InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ Set oOutParams = oReg.ExecMethod_("CreateKey", oInParams, , oCtx)
+ Next
+
+ If UCase(Left(keyType,4)) <> "REG_" Then keyType = "REG_" & keyType
+ Select Case UCase(keyType)
+ Case "REG_SZ"
+ operation = "SetStringValue"
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+ oInParams.sValue = value
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+ Case "REG_DWORD"
+ operation = "SetDWORDValue"
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+ oInParams.uValue = value
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+
+ 'Array(&h00,&h01,&h02,&hff)
+ Case "REG_BINARY"
+ operation = "SetBinaryValue"
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+ oInParams.uValue = value
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+
+ Case "REG_EXPAND_SZ"
+ operation = "SetExpandedStringValue"
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+ oInParams.sValue = value
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+
+ 'Array ("Value 1","Value 2","Value 3")
+ Case "REG_MULTI_SZ"
+ operation = "SetMultiStringValue"
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+ oInParams.sValue = value
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+
+ Case Else
+ ErrorHandling 1, "WriteReg: Wrong Parameter (KeyType)"
+ Exit Function
+ End Select
+
+ ret = oOutParams.ReturnValue
+
+ On Error Resume Next
+ keyType = UCase(keyType)
+
+ Select Case UCase(keyType)
+ Case "REG_SZ","REG_DWORD","REG_EXPAND_SZ"
+ strTemp = "WriteReg: " & key & ", " & CStr(value) & ", " & keyType & ", " & CStr(hive)
+ Case "REG_BINARY"
+ strTemp = "WriteReg: " & key & ", " & Join(value,"|") & ", " & keyType & ", " & CStr(hive)
+ Case "REG_MULTI_SZ"
+ strTemp = "WriteReg: " & key & ", " & Join(value," | ") & ", " & keyType & ", " & CStr(hive)
+ End Select
+
+ On Error Goto 0
+
+ If ret = 0 Then
+ VbsLog "+ RESULT WriteReg: OK"
+ Ret = True
+ Else
+ ErrorHandling ret, "+ RESULT WriteReg: ERROR | (" & ret & ")"
+ End If
+
+ WriteReg = ret
+End Function
+
+'----- ReadINI -----
+'Description: Reads a value from a INI-File
+'Usage: ReadINI ,,
+'Output: Value if found (space if value is blank), False if not,
+'Example: ReadINI "win.ini","Setup","Sample"
+'-------------------------
+Function ReadINI( myFilePath, mySection, myKey )
+ Const ForReading = 1
+ Const ForWriting = 2
+ Const ForAppending = 8
+
+ Dim intEqualPos
+ Dim objFSO, objIniFile
+ Dim strFilePath, strKey, strLeftString, strLine, strSection
+
+ Set objFSO = CreateObject( "Scripting.FileSystemObject" )
+
+ ReadIni = ""
+ strFilePath = Trim( myFilePath )
+ strSection = Trim( mySection )
+ strKey = Trim( myKey )
+
+ If objFSO.FileExists( strFilePath ) Then
+ Set objIniFile = objFSO.OpenTextFile( strFilePath, ForReading, False, -2 )
+ Do While objIniFile.AtEndOfStream = False
+ strLine = Trim( objIniFile.ReadLine )
+
+ ' Check if section is found in the current line
+ If LCase( strLine ) = "[" & LCase( strSection ) & "]" Then
+ strLine = Trim( objIniFile.ReadLine )
+
+ ' Parse lines until the next section is reached
+ Do While Left( strLine, 1 ) <> "["
+ ' Find position of equal sign in the line
+ intEqualPos = InStr( 1, strLine, "=", 1 )
+ If intEqualPos > 0 Then
+ strLeftString = Trim( Left( strLine, intEqualPos - 1 ) )
+ ' Check if item is found in the current line
+ ' Chr(9) = TAB
+ If LCase( Replace(strLeftString, Chr(9), "") ) = LCase( strKey ) Then
+ ReadIni = Trim( Mid( strLine, intEqualPos + 1 ) )
+ ' In case the item exists but value is blank
+ If ReadIni = "" Then
+ ReadIni = " "
+ End If
+ ' Abort loop when item is found
+ Exit Do
+ End If
+ End If
+
+ ' Abort if the end of the INI file is reached
+ If objIniFile.AtEndOfStream Then Exit Do
+
+ ' Continue with next line
+ strLine = Trim( objIniFile.ReadLine )
+ Loop
+ Exit Do
+ End If
+ Loop
+ objIniFile.Close
+ Else
+ ReadINI = False
+ End If
+End Function
+
+'----- WriteINI -----
+'Description: Writes a value to a INI-File
+'Usage: WriteINI ,,,
+'Output: True if set, False if not
+'Example: WriteINI "win.ini","Setup","Sample","Text"
+'Parameters: will be deleted if is ""
+'-------------------------
+Function WriteINI( myFilePath, mySection, myKey, myValue )
+ Const ForReading = 1
+ Const ForWriting = 2
+ Const ForAppending = 8
+
+ Dim blnInSection, blnKeyExists, blnSectionExists, blnWritten
+ Dim intEqualPos
+ Dim objFSO, objNewIni, objOrgIni
+ Dim strFilePath, strFolderPath, strKey, strLeftString
+ Dim strLine, strSection, strTempDir, strTempFile, strValue
+
+ strFilePath = Trim( myFilePath )
+ strSection = Trim( mySection )
+ strKey = Trim( myKey )
+ strValue = Trim( myValue )
+
+ Set objFSO = CreateObject( "Scripting.FileSystemObject" )
+
+ strTempDir = wshShell.ExpandEnvironmentStrings( "%TEMP%" )
+ strTempFile = objFSO.BuildPath( strTempDir, objFSO.GetTempName )
+
+ Set objOrgIni = objFSO.OpenTextFile( strFilePath, ForReading, True, -2 )
+ Set objNewIni = objFSO.CreateTextFile( strTempFile, False, False )
+
+ blnInSection = False
+ blnSectionExists = False
+ ' Check if the specified key already exists
+ blnKeyExists = ( ReadIni( strFilePath, strSection, strKey ) <> "" )
+ blnWritten = False
+
+ ' Check if path to INI file exists, quit if not
+ strFolderPath = Mid( strFilePath, 1, InStrRev( strFilePath, "\" ) )
+ If Not objFSO.FolderExists ( strFolderPath ) Then
+
+ ErrorHandling 1, "Folder of INI-File does not exist"
+ Set objOrgIni = Nothing
+ Set objNewIni = Nothing
+ Set objFSO = Nothing
+ WriteINI = False
+ Exit Function
+ End If
+
+ While objOrgIni.AtEndOfStream = False
+ strLine = Trim( objOrgIni.ReadLine )
+ If blnWritten = False Then
+ If LCase( strLine ) = "[" & LCase( strSection ) & "]" Then
+ blnSectionExists = True
+ blnInSection = True
+ ElseIf InStr( strLine, "[" ) = 1 Then
+ blnInSection = False
+ End If
+ End If
+
+ If blnInSection Then
+ If blnKeyExists Then
+ intEqualPos = InStr( 1, strLine, "=", vbTextCompare )
+ If intEqualPos > 0 Then
+ strLeftString = Trim( Left( strLine, intEqualPos - 1 ) )
+ If LCase( strLeftString ) = LCase( strKey ) Then
+ If strValue <> "" Then
+ VbsLog "OK | Set Value: " & strKey & "=" & strValue & " in [" & strSection & "]"
+ objNewIni.WriteLine strKey & "=" & strValue
+ WriteINI = True
+ End If
+ blnWritten = True
+ blnInSection = False
+ End If
+ End If
+ If Not blnWritten Then
+ objNewIni.WriteLine strLine
+ End If
+ Else
+ objNewIni.WriteLine strLine
+ If strValue <> "" Then
+ VbsLog "OK | New Value: " & strKey & "=" & strValue & " in [" & strSection & "]"
+ objNewIni.WriteLine strKey & "=" & strValue
+ WriteINI = True
+ End If
+ blnWritten = True
+ blnInSection = False
+ End If
+ Else
+ objNewIni.WriteLine strLine
+ End If
+ Wend
+
+ If blnSectionExists = False Then ' section doesn't exist
+ objNewIni.WriteLine
+ VbsLog "OK | New Section: " & "[" & strSection & "]"
+ objNewIni.WriteLine "[" & strSection & "]"
+ If strValue <> "" Then
+ VbsLog "OK | New Value: " & strKey & "=" & strValue
+ objNewIni.WriteLine strKey & "=" & strValue
+ WriteINI = True
+ End If
+ End If
+
+ objOrgIni.Close
+ objNewIni.Close
+
+ ' Delete old INI file
+ objFSO.DeleteFile strFilePath, True
+ ' Rename new INI file
+ objFSO.CopyFile strTempFile, strFilePath
+ objFSO.DeleteFile strTempFile, True
+
+ Set objOrgIni = Nothing
+ Set objNewIni = Nothing
+ Set objFSO = Nothing
+End Function
+
+'----- VersionCheck -----
+'Description: Compares version numbers
+'Usage: VersionCheck ,
+'Output: Position of different version, positiv or negativ value, 0 if no difference
+'Example: VersionCheck "1.2.3","1.2.5"
+' Returns -3, because the first version ist lower at position three
+'------------------------
+Function VersionCheck(a,b)
+Dim Nr1,Nr2,i
+Nr1=split(a,".")
+Nr2=split(b,".")
+
+For i=0 To UBound(Nr1)
+ If i > UBound(Nr2) Then
+ Versioncheck = 0
+ Exit Function
+ End If
+
+ If Int(Nr1(i)) < Int(Nr2(i)) Then
+ Versioncheck = -(i + 1)
+ Exit Function
+ ElseIf Int(Nr1(i)) > Int(Nr2(i)) Then
+ Versioncheck = i + 1
+ Exit Function
+ End If
+ Versioncheck = 0
+Next
+End Function
+
+'===== VersionCheckNew =========================================================================
+'Description: Compares version numbers
+'Usage: VersionCheckNew ,
+'Output: If Version1 < Version2, returns -1
+' if Version1 = Version2, returns 0
+' If Version1 > Version2, returns 1
+'Example:
+' Dim Version1
+' Dim Version2
+'
+' Version1 = GetFileVersion (ProgramFiles & "\Internet Explorer\iexplore.exe")
+' Version2 = "46.1.879778.258"
+'
+' if VersionCheckNew (Version1, Version2) = -1 Then
+' VbsLog Version1 + " ist kleiner als " + Version2 + "do something"
+' End If
+'
+' if VersionCheckNew (Version1, Version2) = 1 Then
+' VbsLog Version1 + " ist groesser als " + Version2 + "do something"
+' End If
+'
+' if VersionCheckNew (Version1, Version2) = 0 Then + "do something"
+' VbsLog Version1 + " ist gleich " + Version2
+' End If
+'
+
+' Compares two versions "a.b.c.d". If Version1 < Version2,
+' returns -1; if Version1 = Version2, returns 0;
+' If Version1 > Version2, Returns 1.
+Function VersionCheckNew(ByVal Version1, ByVal Version2)
+ Dim Ver1, Ver2, Result
+ Ver1 = GetVersionStringAsArray(Version1)
+ Ver2 = GetVersionStringAsArray(Version2)
+ If Ver1(0) < Ver2(0) Then
+ Result = -1
+ ElseIf Ver1(0) = Ver2(0) Then
+ If Ver1(1) < Ver2(1) Then
+ Result = -1
+ ElseIf Ver1(1) = Ver2(1) Then
+ Result = 0
+ Else
+ Result = 1
+ End If
+ Else
+ Result = 1
+ End If
+
+ VersionCheckNew = Result
+
+ End Function
+
+
+' Returns a version string "a.b.c.d" as a two-element numeric
+' array. The first array element is the most-significant 32 bits,
+' and the second element is the least-significant 32 bits. (used in VersionCheckNew)
+Sub GetVersionStringAsArray(ByVal Version)
+ Dim VersionAll, VersionParts, N
+ VersionAll = Array(0, 0, 0, 0)
+ VersionParts = Split(Version, ".")
+ For N = 0 To UBound(VersionParts)
+ VersionAll(N) = CLng(VersionParts(N))
+ Next
+
+ Dim Hi, Lo
+ Hi = Lsh(VersionAll(0), 16) + VersionAll(1)
+ Lo = Lsh(VersionAll(2), 16) + VersionAll(3)
+
+ GetVersionStringAsArray = Array(Hi, Lo)
+End Sub
+
+' Bitwise left shift. (used in GetVersionStringAsArray)
+Sub Lsh(ByVal N, ByVal Bits)
+ Lsh = N * (2 ^ Bits)
+End Sub
+'=================================================================================================
+
+'----- XMLErrordescription -----
+'Description: Get Errordescription from XML-File
+'Usage: XMLErrordescription
+'Output: XMLErrordescription
+'Example: XMLErrordescription 1603
+'------------------------
+Function XMLErrordescription(ErrorNumber)
+ Dim xmlDoc, xmlNodes
+ Set xmlDoc = CreateObject("Microsoft.XMLDOM")
+
+ xmlDoc.Async = "False"
+ xmlDoc.Load("Errorhandling.xml")
+ For Each xmlNodes In xmlDoc.SelectNodes("//Errorhandling/Errorlist/Error")
+ If Trim(xmlnodes.getAttribute("Errornumber")) = Trim(Errornumber) Then
+ XMLErrordescription = xmlNodes.getAttribute("Description")
+ End If
+ Next
+ For Each xmlNodes In xmlDoc.SelectNodes("//Errorhandling/Successlist/Success")
+ If Trim(xmlnodes.getAttribute("Errornumber")) = Trim(Errornumber) Then
+ XMLErrordescription = xmlNodes.getAttribute("Description")
+ End If
+ Next
+End Function
+
+
+'----- GetOUByComputerName -----
+'Description: Find OU-AD for Computername
+'Usage: GetOUByComputerName(computerName)
+'Output: "OU-Container" or "Not"
+' "OU=CAT,OU=CAT,OU=AUDI AG,dc=audi,dc=vwg"
+'--------------------------------------
+Function GetOUByComputerName(byval computerName)
+
+ Dim namingContext, ldapFilter, ou
+ Dim cn, cmd, rs
+ Dim objRootDSE
+
+ ' Bind RootDSE for Default Namenscontext
+ Set objRootDSE = getobject("LDAP://RootDSE")
+ namingContext = objRootDSE.Get("defaultNamingContext")
+ Set objRootDSE = nothing
+
+ ' Create Computerobjekts
+ ldapFilter = ";(&(objectCategory=Computer)(name=" & computerName & "))" & _
+ ";distinguishedName;subtree"
+
+ ' ADO Query to Database
+ Set cn = createobject("ADODB.Connection")
+ Set cmd = createobject("ADODB.Command")
+
+ cn.open "Provider=ADsDSOObject;"
+ cmd.activeconnection = cn
+ cmd.commandtext = ldapFilter
+
+ set rs = cmd.execute
+
+ If rs.eof <> true and rs.bof <> true then
+ ou = rs(0)
+ ' to: CN=AUDIINXxxxxxxx OU=Computers,OU=IFP822,OU=FP,OU=F,OU=AUDI AG,DC=audi,DC=vwg
+ ' e.g. OU=CAT,OU=CAT,OU=AUDI AG,dc=audi,dc=vwg
+ getOUByComputerName = ou
+ Else
+ getOUByComputerName = "NOT"
+ End if
+
+ rs.close
+ cn.close
+
+End Function
+
+'----- CreateBrandingInformation -----
+'Description: Create branding information from values out of _install.vbs
+'Usage: CreateBrandingInformation()
+'-------------------------------------
+Function CreateBrandingInformation(pName, pVersion, pLang, pRevision)
+
+ Dim pBrandingName : pBrandingName = pName &"_"& pVersion &"_"& pLang &"_"& pRevision
+ DIM pNow: pNow = Now
+
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\ProductName" ,pName, 32
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\ProductVersion", pVersion, 32
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\ProductLanguage", pLang, 32
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\Revision", pRevision, 32
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\InstallDate", pNow, 32
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\AES", pAES, 32
+
+End Function
+
+'----- DeleteOldBrandingInformation -----
+'Description: Delete previous branding information from values out of _uninstall.vbs
+'Usage: DeleteOldBrandingInformation , , ,
+'-------------------------------------
+Function DeleteOldBrandingInformation(pNameOld, pLangOld, pRevisionOld, pVersionOld)
+ Dim pBrandingName : pBrandingName = pNameOld &"_"& pVersionOld &"_"& pLangOld &"_"& pRevisionOld
+ Dim pRegpath : pRegpath = "HKLM\Software\"&pCustomer&"\InstalledProducts"
+ dim pRegType : pRegType = "KEY"
+ DeleteReg pRegType, pRegpath &"\"& pBrandingName, 32
+
+End Function
+
+'----- CreateBrandingInformationExt -----
+
+Function CreateBrandingInformationExt(pName, pVersion, pLang, pRevision, pRegpath)
+
+ Dim pNow: pNow = Now
+ DIM pCustomer : pCustomer = "VWG"
+ Dim pBrandingName : pBrandingName = pName &"_"& pVersion &"_"& pLang &"_"& pRevision
+
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\ProductName" ,pName, 32
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\ProductVersion", pVersion, 32
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\ProductLanguage", pLang, 32
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\Revision", pRevision, 32
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\InstallDate", pNow, 32
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\AES", pAES, 32
+
+End Function
+
+'----- DeleteBrandingInformation -----
+'Description: Delete branding information from values out of _uninstall.vbs
+'Usage: DeleteBrandingInformation(Name, Version, Lang, Revision)
+'-------------------------------------
+Function DeleteBrandingInformation(Name, Version, Lang, Revision)
+
+ Dim pBrandingName : pBrandingName = Name & "_" & Version & "_" & Lang & "_" & Revision
+ Dim pRegpath : pRegpath = "HKLM\Software\VWG\InstalledProducts\"
+ dim pRegType : pRegType = "KEY"
+ DeleteReg pRegType, pRegpath & pBrandingName, 32
+
+End Function
+
+'----- CheckLockScreen -----
+
+Function CheckLockScreen()
+ DIM IsWorkstationLocked
+ Dim wmi : Set wmi = GetObject("winmgmts://" & computername & "/root/cimv2")
+ Dim logonScreenCount : logonScreenCount = wmi.ExecQuery ("SELECT * FROM Win32_Process WHERE Name = 'LogonUI.exe'").Count
+ If logonScreenCount > 0 then
+ LockScreenActive = true
+ vbslog "LockScreen is active"
+ else
+ LockScreenActive = false
+ vbslog "LockScreen is inactive"
+ end if
+
+End Function
+
+' ---- PanelWait2 ----
+
+Function PanelWait2(process,timewait,rep, xmlFile)
+ Dim Count : Count = 0
+ PanelWait2 = True
+ If CheckProc("TsBootShell.exe,TsmBootstrap.exe,TSManager.exe,TSProgressUI.exe,SMSBoot.exe") = True Then
+ VbsLog "Information | OSD-Installation or tasksequence is running. Panel skipped."
+ Exit Function
+ End If
+ dim CurrentUserSID : CurrentUserSID = GetCurrentUserSID()
+ If CurrentUserSID <> "" then VbsLog "CurrentUserSID | "&CurrentUserSID&""
+ DIM CurrentUser : CurrentUser = GetCurrentUser()
+ If CurrentUser <> "" then
+ VbsLog "CurrentUser | "&CurrentUser&""
+
+ Do While (rep>0) And (CheckProc(process))
+ run "Blende SCCM","Infoblende\AudiSysWrapper.exe Infoblende.exe " & xmlFile & " /w","0"
+ KillProc process
+ Do While (Count<(timewait/10)) And CheckProc(process) = True
+ VbsLog "Process = "&process&""
+ WScript.Sleep(10000)
+ Count = Count + 1
+ Loop
+ rep = rep - 1
+ Count = 0
+ Loop
+ If CheckProc(process) = True Then PanelWait2 = False
+
+ end if
+End Function
+
+
+'----- Check VPN Connected ----
+
+Function CheckVPNConnected()
+ Dim objWMIService, colItems, objItem, objItem2
+ Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration",,48)
+ CheckVPNConnected = False
+
+ For Each objItem in colItems
+ If InStr(objItem.Description, "Check Point") <> 0 Or InStr(objItem.Description, "Cisco AnyConnect") <> 0 Then
+ If objItem.IPEnabled = True Then
+ For Each objItem2 In objItem.IPAddress
+ If Left(objItem2, 2) <> "0." Then
+ CheckVPNConnected = True
+ End If
+ Next
+ End If
+ End If
+ Next
+End Function
+
+'===========================================================================================
+' Addition from 15.09.2016
+'===========================================================================================
+
+'----- CreateBranding -----
+Function CreateBranding(Validity, Name, Version, OSValidity, Lang, Revision, AES)
+
+ Dim BrandingName : BrandingName = Validity & "_" & Name & "_" & OSValidity & "_" & Version & "_" & Lang & "_" & Revision
+ DIM pRegpath : pRegpath = "HKLM\Software\VWG\InstalledProducts"
+ DIM pCustomer : pCustomer = "VWG"
+ Dim pNow : pNow = Now
+
+ WriteReg "REG_SZ", pRegpath& "\" & BrandingName & "\ProductName" ,Validity & "_" & Name & "_" & OSValidity, 32
+ WriteReg "REG_SZ", pRegpath& "\" & BrandingName & "\ProductVersion", Version, 32
+ WriteReg "REG_SZ", pRegpath& "\" & BrandingName & "\ProductLanguage", Lang, 32
+ WriteReg "REG_SZ", pRegpath& "\" & BrandingName & "\Revision", Revision, 32
+ WriteReg "REG_SZ", pRegpath& "\" & BrandingName & "\InstallDate", Now, 32
+ WriteReg "REG_DWORD", pRegpath& "\" & BrandingName & "\Installed", 1, 32
+ WriteReg "REG_SZ", pRegpath& "\" & BrandingName & "\AES", AES, 32
+
+End Function
+
+'----- DeleteBranding -----
+Function DeleteBranding(Validity, Name, Version, OSValidity, Lang, Revision)
+
+ Dim DelBranding : DelBranding = Validity & "_" & Name & "_" & OSValidity & "_" & Version & "_" & Lang & "_" & Revision
+ Dim pRegpath : pRegpath = "HKLM\Software\VWG\InstalledProducts\"
+ DeleteReg "KEY", pRegpath & DelBranding, 32
+
+End Function
+
+'----- Uninstall MSI -----
+'Description: Uninstall application with if installed
+'Usage: UninstallMSI ,
+'Output Returncode of uninstall if product ist deinstalled, False if product was not installed
+'Example: UninstallMSI "Apple QuickTime","{B332732A-4958-41DD-B439-DDA2D32753C5}"
+'-----------------------------
+Function UninstallMSI(Name,ProductCode)
+
+ Dim objInstaller, UninstallLogName
+ Dim UninstallName : UninstallName = pValidity & "_" & pName & "_" & pOSValidity & "_" & pVersion & "_" & pLang & "_" & pRevision
+
+ Const msiInstallStateUnknown = -1 'The product is neither advertised or installed.
+ Set objInstaller = WScript.CreateObject("WindowsInstaller.Installer")
+ If objInstaller.ProductState(ProductCode) <> msiInstallStateUnknown Then
+ VbsLog "Uninstall " & Name & ": " & ProductCode
+ VbsLog "+ ProductName: " & objInstaller.ProductInfo(ProductCode, "ProductName")
+ VbsLog "+ Version: " & objInstaller.ProductInfo(ProductCode, "VersionString")
+ VbsLog "+ Publisher: " & objInstaller.ProductInfo(ProductCode, "Publisher")
+ UninstallLogName = LogDir & UninstallName & "_msi-uninstall.log"
+ run "Uninstall","msiexec.exe /x " & ProductCode & " /qn /norestart /lvoicewarmup+ """ & UninstallLogName & """", "0,1605,3010"
+ UninstallMSI = True
+ Else
+ VbsLog "Information | Uninstall Function:" & Name & " is not installed " & ProductCode
+ UninstallMSI = False
+ End If
+
+End Function
+
+'----- Uninstall MSI with custom Logfile-----
+'Description: Uninstall application with if installed
+'Usage: UninstallMSICustomLog ,
+'Output Returncode of uninstall if product ist deinstalled, False if product was not installed
+'Example: UninstallMSICustomLog "Apple QuickTime","{B332732A-4958-41DD-B439-DDA2D32753C5}","Apple_Quicktime_7.1.19_msi-uninstll.log"
+'-----------------------------
+Function UninstallMSICustomLog(Name,ProductCode,UninstallLogName)
+
+ Dim objInstaller
+
+ Const msiInstallStateUnknown = -1 'The product is neither advertised or installed.
+ Set objInstaller = WScript.CreateObject("WindowsInstaller.Installer")
+ UninstallLogName = LogDir & UninstallLogName
+ If objInstaller.ProductState(ProductCode) <> msiInstallStateUnknown Then
+ VbsLog "Uninstall " & Name & ": " & ProductCode
+ VbsLog "+ ProductName: " & objInstaller.ProductInfo(ProductCode, "ProductName")
+ VbsLog "+ Version: " & objInstaller.ProductInfo(ProductCode, "VersionString")
+ VbsLog "+ Publisher: " & objInstaller.ProductInfo(ProductCode, "Publisher")
+ run "Uninstall","msiexec.exe /x " & ProductCode & " /qn /norestart /lvoicewarmup+ """ & UninstallLogName & """", "0,1605,3010"
+ UninstallMSICustomLog = True
+ Else
+ VbsLog "Information | Uninstall Function:" & Name & " is not installed " & ProductCode
+ UninstallMSICustomLog = False
+ End If
+
+End Function
+
+'----- Install MSI -----
+'Description: Install MSI Application
+'Usage: InstallMSI ,,,
+'Output n/a
+'Example: InstallMSI pName & " " & pVersion,"Files\test.msi","Test.mst",""
+'-----------------------------
+Function InstallMSI(Name,PathtoMSI,MST,Properties)
+
+ Dim InstallLogName
+ If Properties <> "" Then Properties = " " & Properties
+ If MST <> "" Then MST = " TRANSFORMS=" & MST
+ VbsLog "Installation: " & Name
+ InstallLogName = LogDir & Name & "_msi-install.log"
+ run "Install " & Name,"msiexec.exe /i """ & PathtoMSI & """" & MST & " ARPNOREMOVE=1 ARPNOMODIFY=1 ARPNOREPAIR=1" & Properties & " /qn /norestart /lvoicewarmup """ & InstallLogName & """", "0,3010"
+
+End Function
+
+'----- Install MSI with custom defined Log Name -----
+'Description: Install MSI application with custom defined Log Name
+'Usage: InstallMSICustomLogName ,,,,
+'Output n/a
+'Example: InstallMSICustomLogName pName & " " & pVersion,"Files\test.msi","Test.mst","","Test_MSI-Install.log"
+'-----------------------------
+Function InstallMSICustomLogName(Name,PathtoMSI,MST,Properties,InstallLogName)
+
+ If Properties <> "" Then Properties = " " & Properties
+ If MST <> "" Then MST = " TRANSFORMS=" & MST
+ VbsLog "Installation: " & Name
+ InstallLogName = LogDir & InstallLogName
+ run "Install " & Name,"msiexec.exe /i """ & PathtoMSI & """" & MST & " ARPNOREMOVE=1 ARPNOMODIFY=1 ARPNOREPAIR=1" & Properties & " /qn /norestart /lvoicewarmup """ & InstallLogName & """", "0,3010"
+
+End Function
+
+'----- Create Active Setup -----
+'Description: Creates an active setup
+'Usage: CreateActiveSetup()
+'Output: n/a
+'------------------------
+Function CreateActiveSetup()
+
+ Dim ActiveSetupName : ActiveSetupName = pValidity & "_" & pName & "_" & pOSValidity & "_" & pVersion & "_" & pLang & "_" & pRevision
+ Dim Pfad : Pfad = "wscript.exe ""c:\windows\sw-source\" & ActiveSetupName & "\ActiveSetup.vbs"" //B"
+ Dim Version : Version = pVersion
+ VbsLog "---------- Execute Active Setup Function: '" & ActiveSetupName & "' '" & Pfad
+ If CheckFolder ("ActiveSetup") Then
+ CreateFolder WinDir & "\SW-Source\" & ActiveSetupName
+ CopyFile "ActiveSetup\*.*", WinDir & "\SW-Source\" & ActiveSetupName & "\"
+ CopyFile ".\_Functions.vbs", WinDir & "\SW-Source\" & ActiveSetupName & "\"
+ End If
+
+ Version = Replace(Version,".",",")
+
+ Ret = WriteReg ("REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & ActiveSetupName & "\", "ActiveSetup " & ActiveSetupName, GetOSBit())
+ WriteReg "REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & ActiveSetupName & "\StubPath", Pfad, GetOSBit()
+ WriteReg "REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & ActiveSetupName & "\Version", Version, GetOSBit()
+
+ If Ret = True Then
+ VbsLog "---------- RESULT CreateActiveSetup: OK"
+ Else
+ ErrorHandling 1,"---------- RESULT CreateActiveSetup: ERROR"
+ End If
+
+End Function
+
+
+'----- Remove Active Setup -----
+'Description: Removes an active setup
+'Usage: RemoveActiveSetup()
+'Output: n/a
+'------------------------
+Function RemoveActiveSetup()
+
+ Dim RemovalName : RemovalName = pValidity & "_" & pName & "_" & pOSValidity & "_" & pVersion & "_" & pLang & "_" & pRevision
+ DeleteReg "Key", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & RemovalName, GetOSBit()
+ DeleteFolder WinDir & "\SW-Source\" & RemovalName
+
+End Function
diff --git a/Clientcheck/_Install.bat b/Clientcheck/_Install.bat
new file mode 100644
index 0000000..385386c
--- /dev/null
+++ b/Clientcheck/_Install.bat
@@ -0,0 +1,9 @@
+@echo off
+rem abfrage 32/64?
+set pfad=%windir%\system32
+if exist "%windir%\SysWOW64" set pfad=%windir%\SysWOW64
+
+rem vbs start
+%pfad%\cscript.exe "%~dp0_Install.vbs"
+echo Errorlevel: %ERRORLEVEL%
+pause
\ No newline at end of file
diff --git a/Clientcheck/_Install.vbs b/Clientcheck/_Install.vbs
new file mode 100644
index 0000000..dc2e67c
--- /dev/null
+++ b/Clientcheck/_Install.vbs
@@ -0,0 +1,34 @@
+Option Explicit
+Dim pValidity, pName, pVersion, pOSValidity, pLang, pRevision, pAES, pCustomer
+
+pValidity = "INA"
+pName = "Apple_QuicktimeUninstaller"
+pVersion = "1.0"
+pOSValidity = "ALL"
+pLang = "ZXX"
+pRevision = "0001"
+pAES = "AES-1-002793-A"
+pCustomer = "VWG"
+
+
+'----- Functions.vbs einbinden
+Dim olibfso : Set olibfso = CreateObject("Scripting.FileSystemObject")
+ExecuteGlobal olibfso.OpenTextFile(olibfso.GetParentFolderName(Wscript.ScriptFullName) + "\_Functions.vbs", 1, false).ReadAll
+Set olibfso = nothing
+
+
+LogEnabled = True
+
+ClientInfo()
+
+'----- Clients (Delete this block if not needed)
+
+AC2_32_O = 1
+AC2_64_O = 1
+
+AC3_Alpha = 1
+
+ClientCheck()
+
+
+
diff --git a/Clientcheck/_Uninstall.bat b/Clientcheck/_Uninstall.bat
new file mode 100644
index 0000000..d5cf60a
--- /dev/null
+++ b/Clientcheck/_Uninstall.bat
@@ -0,0 +1,9 @@
+@echo off
+rem abfrage 32/64?
+set pfad=%windir%\system32
+rem if exist "%windir%\SysWOW64" set pfad=%windir%\SysWOW64
+
+rem vbs start
+%pfad%\cscript.exe "%~dp0_Uninstall.vbs"
+echo Errorlevel: %ERRORLEVEL%
+pause
\ No newline at end of file
diff --git a/Clientcheck/_Uninstall.vbs b/Clientcheck/_Uninstall.vbs
new file mode 100644
index 0000000..286aa7f
--- /dev/null
+++ b/Clientcheck/_Uninstall.vbs
@@ -0,0 +1,28 @@
+Option Explicit
+Dim pValidity, pName, pVersion, pOSValidity, pLang, pRevision
+
+pValidity = "INA"
+pName = "Apple_QuicktimeUninstaller"
+pVersion = "1.0"
+pOSValidity = "ALL"
+pLang = "ZXX"
+pRevision = "0001"
+
+'----- Functions.vbs einbinden
+Dim olibfso : Set olibfso = CreateObject("Scripting.FileSystemObject")
+ExecuteGlobal olibfso.OpenTextFile(olibfso.GetParentFolderName(Wscript.ScriptFullName) + "\_Functions.vbs", 1, false).ReadAll
+Set olibfso = nothing
+
+LogEnabled = True
+
+'----- START Uninstallation -----
+
+VbsLog "----- Start Deinstallation " & pName & " " & pVersion
+
+'---- delete branding -----
+DeleteBranding pValidity, pName, pVersion, pOSValidity, pLang, pRevision
+
+VbsLog "----- Ende Deinstallation"
+
+'----- ENDE Uninstallation -----
+FinishScript()
\ No newline at end of file
diff --git a/Java Tool/GUI_JAVA_TOOL.bat b/Java Tool/GUI_JAVA_TOOL.bat
new file mode 100644
index 0000000..cbabe33
--- /dev/null
+++ b/Java Tool/GUI_JAVA_TOOL.bat
@@ -0,0 +1,361 @@
+@echo off
+::
+::VERSION 29.01.2018
+::
+:startnew
+cls
+set Arbeitsverzeichnis=%1"
+set Arbeitsverzeichnis=%Arbeitsverzeichnis:"=%
+set VERZ=%~dp0
+echo ************************************************
+echo **************************************************
+echo **** ****
+echo ** **
+echo *** -= Java-Tool-/ Updates- TOOL =- ***
+echo **** ****
+echo *************************************************
+echo ********************************************************************
+echo ***** -= JAVA - TOOL =- ******
+echo *******************************************************************************
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** ********
+echo ******** -= M-E-N-U-E =- ********
+echo ******** ********
+echo ******** ********
+echo ******** Die Deinstallationsroutinen loeschen alles. ********
+echo ******** Die Installationsroutinen sind modifiziert: ********
+echo ******** ********
+echo ******** 1= kompl. Java Deinst. und Inst. 8u381 + addon enable ********
+echo ******** 4= kompl. Java Deinstallation ********
+echo ******** 6= Wlan zert. loeschen ********
+echo ******** 8= Addon im IE ausschalten ********
+echo ******** 9= Addon im IE einschalten ********
+echo ******** 10= Addon deaktivierung aussschalten ********
+echo ******** 11= Inst. Secure Config 4.8 ********
+echo ******** ********
+echo *******************************************************************************
+echo ******************************************************************************
+echo *****************************************************************************
+echo.
+echo.
+echo.
+
+set /p Rechnername= Bitte Rechnernamen/Hostnamen eingeben:
+::Prfen, ob Rechner anpingbar ist.
+ping %Rechnername% -n 1
+timeout /T 1 > nul
+IF NOT %ERRORLEVEL%==0 echo ***** ACHTUNG: Rechner konnte nicht angepingt werden
+IF NOT %ERRORLEVEL%==0 set ERRORLEVEL=2 & goto EOF
+
+
+if NOT exist "\\%Rechnername%\c$\windows\" (echo **** KEIN ZUGRIFF AUF RECHNER & set errorlevel=-1 & goto EOF)
+if exist "\\%Rechnername%\c$\windows\SysWOW64\" (set bitVersion=64) else (set bitVersion=32)
+
+:: 1008er Version hat keine psexec mehr.
+::if NOT exist "\\%Rechnername%\c$\Program Files (x86)\Tools\" (copy "%VERZ%\pkg\psexec.exe" "\\%Rechnername%\c$\Windows\System32\psexec.exe" /Y)
+
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Rechnername: %Rechnername%
+echo ******** OS: Windows 7 %bitVersion% Bit
+echo *******************************************************************************
+echo ******************************************************************************
+
+set /p Reparatur=Bitte waehlen Sie eine Option aus:
+
+if "%Reparatur%"=="1" goto rep1
+if "%Reparatur%"=="2" goto rep2
+if "%Reparatur%"=="3" goto rep3
+if "%Reparatur%"=="4" goto rep4
+if "%Reparatur%"=="5" goto rep5
+if "%Reparatur%"=="6" goto rep6
+if "%Reparatur%"=="7" goto rep7
+if "%Reparatur%"=="8" goto rep8
+if "%Reparatur%"=="9" goto rep9
+if "%Reparatur%"=="10" goto rep10
+goto EOF
+
+
+:: **************************************** Rep 1 ****************************************
+:rep1
+::Kopieren Clearing-Dateien
+copy "%VERZ%\KEYS.ini" "\\%Rechnername%\c$\windows\system32\KEYS.ini"
+copy "%VERZ%\SYSTEM CLEARJAVA.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM CLEARJAVA.bat"
+
+
+::Clearing
+psexec \\%Rechnername% -s "SYSTEM CLEARJAVA.bat" -f
+
+
+::Loeschen Clearing-Dateien
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM CLEARJAVA.bat"
+del "\\%Rechnername%\c$\Windows\System32\KEYS.ini"
+
+:: Clearing abgeschlossen - Installation
+
+::Kopieren der Java-Version
+robocopy "%VERZ%\pkg\Config4.6" "\\%Rechnername%\c$\Temp\Config4.6" /mir
+robocopy "%VERZ%\pkg\Java_8U192_32" "\\%Rechnername%\c$\Temp\Java_8U192_32" /mir
+robocopy "%VERZ%\pkg\Java_8U192_64" "\\%Rechnername%\c$\Temp\Java_8U192_64" /mir
+
+echo ******** Installation
+echo ******** Meldung mit ".ps1 file specified on command-line..." ignorieren
+::Install
+psexec -s \\%Rechnername% "c:\Temp\Java_8U192_32\_Install.cmd"
+psexec -s \\%Rechnername% "c:\Temp\Java_8U192_64\_Install.cmd"
+psexec -s \\%Rechnername% "c:\Temp\Config4.6\_Install.cmd"
+
+::Loeschen
+echo ******** Loeschen Installationsordner
+echo ******** Loeschen Installationsordner
+rd "\\%Rechnername%\c$\Temp\Java_8U192_32" /s /q
+rd "\\%Rechnername%\c$\Temp\Java_8U192_64" /s /q
+rd "\\%Rechnername%\c$\Temp\Config4.6" /s /q
+
+
+
+:: TEST MIT ADD ON ENABLE
+:: ***************************************************************************************
+copy "%VERZ%\SYSTEM ENABLEADDONS1.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM ENABLEADDONS1.bat"
+psexec \\%Rechnername% -s "SYSTEM ENABLEADDONS1.bat" -f
+::Loeschen
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM ENABLEADDONS1.bat"
+:: ***************************************************************************************
+goto EOF
+:: ***************************************************************************************
+
+
+
+:: **************************************** Rep 2 ****************************************
+:rep2
+::Kopieren Java Reg
+
+copy "%VERZ%\Java_1.8.reg" "\\%Rechnername%\c$\windows\system32\Java_1.8.reg"
+psexec \\%Rechnername% -s reg.exe import c:\windows\system32\Java_1.8.reg
+:: Clearing abgeschlossen - Installation
+goto EOF
+:: ***************************************************************************************
+
+
+:: **************************************** Rep 3 ****************************************
+::
+:rep3
+::Kopieren Clearing-Dateien
+copy "%VERZ%\KEYS.ini" "\\%Rechnername%\c$\windows\system32\KEYS.ini"
+copy "%VERZ%\SYSTEM CLEARJAVA.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM CLEARJAVA.bat"
+::copy "%VERZ%\SYSTEM DISABLEADDONS.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM DISABLEADDONS.bat"
+
+::Clearing
+::psexec \\%Rechnername% -s "SYSTEM DISABLEADDONS.bat" -f
+psexec \\%Rechnername% -s "SYSTEM CLEARJAVA.bat" -f
+
+
+::Loeschen Clearing-Dateien
+::del "\\%Rechnername%\c$\Windows\System32\SYSTEM DISABLEADDONS.bat"
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM CLEARJAVA.bat"
+del "\\%Rechnername%\c$\Windows\System32\KEYS.ini"
+
+:: Clearing abgeschlossen - Installation
+
+::Kopieren der Java-Version
+robocopy "%VERZ%\Config4.6" "\\%Rechnername%\c$\Temp\Config4.6" /mir
+robocopy "%VERZ%\pkg\Java_8U192_32" "\\%Rechnername%\c$\Temp\Java_8U192_32" /mir
+robocopy "%VERZ%\pkg\Java_8U192_64" "\\%Rechnername%\c$\Temp\Java_8U192_64" /mir
+
+
+::Install
+echo ******** Installation
+psexec -s \\%Rechnername% "c:\Temp\Java_8U192_64\_Install.bat"
+psexec -s \\%Rechnername% "c:\Temp\Java_8U192_32\_Install.bat"
+psexec -s \\%Rechnername% "c:\Temp\Config4.6\_Install.bat"
+
+
+
+
+::Loeschen
+echo ******** Loeschen Installationsordner
+rd "\\%Rechnername%\c$\Temp\Java_8U192_32" /s /q
+rd "\\%Rechnername%\c$\Temp\Java_8U192_64" /s /q
+rd "\\%Rechnername%\c$\Temp\Config4.6" /s /q
+
+:: TEST MIT ADD ON ENABLE
+:: ***************************************************************************************
+copy "%VERZ%\SYSTEM ENABLEADDONS1.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM ENABLEADDONS1.bat"
+psexec \\%Rechnername% -s "SYSTEM ENABLEADDONS1.bat" -f
+::Loeschen
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM ENABLEADDONS1.bat"
+:: ***************************************************************************************
+goto EOF
+:: ***************************************************************************************
+
+
+
+:: **************************************** Rep 4 ****************************************
+:rep4
+::Kopieren Inst.Dateien
+copy "%VERZ%\KEYS.ini" "\\%Rechnername%\c$\windows\system32\KEYS.ini
+copy "%VERZ%\SYSTEM CLEARJAVA.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM CLEARJAVA.bat"
+copy "%VERZ%\SYSTEM DISABLEADDONS.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM DISABLEADDONS.bat"
+
+::Clearing
+psexec \\%Rechnername% -s "SYSTEM DISABLEADDONS.bat" -f
+psexec \\%Rechnername% -s "SYSTEM CLEARJAVA.bat" -f
+
+
+::Loeschen Clearing-Dateien
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM DISABLEADDONS.bat"
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM CLEARJAVA.bat"
+del "\\%Rechnername%\c$\Windows\System32\KEYS.ini"
+goto EOF
+:: ***************************************************************************************
+
+
+:: **************************************** Rep 5 ****************************************
+:rep5
+::Kopieren Clearing-Dateien
+copy "%VERZ%\KEYS.ini" "\\%Rechnername%\c$\windows\system32\KEYS.ini"
+copy "%VERZ%\SYSTEM CLEARJAVA.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM CLEARJAVA.bat"
+
+
+::Clearing
+psexec \\%Rechnername% -s "SYSTEM CLEARJAVA.bat" -f
+
+
+::Loeschen Clearing-Dateien
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM CLEARJAVA.bat"
+del "\\%Rechnername%\c$\Windows\System32\KEYS.ini"
+
+:: Clearing abgeschlossen - Installation
+
+::Kopieren der Java-Version
+robocopy "%VERZ%\pkg\JavaSuite-8u13" "\\%Rechnername%\c$\Temp\JavaSuite-8u13" /mir
+
+echo ******** Installation x32
+echo ******** Meldung mit ".ps1 file specified on command-line..." ignorieren
+psexec -s \\%Rechnername% "c:\Temp\JavaSuite-8u13\_Installx86.cmd"
+::Install
+echo ******** Installation x64
+echo ******** Meldung mit ".ps1 file specified on command-line..." ignorieren
+psexec -s \\%Rechnername% "c:\Temp\JavaSuite-8u13\_Installx64.cmd"
+
+
+::Loeschen
+echo ******** Loeschen Installationsordner
+rd "\\%Rechnername%\c$\Temp\JavaSuite-8u13" /s /q
+
+
+:: TEST MIT ADD ON ENABLE
+:: ***************************************************************************************
+copy "%VERZ%\SYSTEM ENABLEADDONS1.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM ENABLEADDONS1.bat"
+psexec \\%Rechnername% -s "SYSTEM ENABLEADDONS1.bat" -f
+::Loeschen
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM ENABLEADDONS1.bat"
+:: ***************************************************************************************
+goto EOF
+:: ***************************************************************************************
+
+
+
+:: **************************************** Rep 6 ****************************************
+:rep6
+copy "%VERZ%\zert\delete_old_certs.bat" "\\%Rechnername%\c$\Temp\delete_old_certs.bat"
+copy "%VERZ%\zert\delete_old_certs.ps1" "\\%Rechnername%\c$\Temp\delete_old_certs.ps1"
+psexec -s \\%Rechnername% "c:\Temp\delete_old_certs.bat"
+
+::Loeschen Clearing-Dateien
+del "\\%Rechnername%\c$\Temp\delete_old_certs.bat"
+del "\\%Rechnername%\c$\Temp\delete_old_certs.ps1"
+
+goto EOF
+:: ***************************************************************************************
+
+
+
+:: **************************************** Rep 7 ****************************************
+:rep7
+::Leer
+goto EOF
+:: ***************************************************************************************
+
+
+
+:: **************************************** Rep 8 ****************************************
+:rep8
+copy "%VERZ%\SYSTEM DISABLEADDONS.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM DISABLEADDONS.bat"
+psexec \\%Rechnername% -s "SYSTEM DISABLEADDONS.bat" -f
+
+::Loeschen Clearing-Dateien
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM DISABLEADDONS.bat"
+goto EOF
+:: ***************************************************************************************
+
+
+:: **************************************** Rep 9 ****************************************
+:rep9
+copy "%VERZ%\SYSTEM ENABLEADDONS.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM ENABLEADDONS.bat"
+psexec \\%Rechnername% -s "SYSTEM ENABLEADDONS.bat" -f
+
+::Loeschen
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM ENABLEADDONS.bat"
+goto EOF
+
+
+:: **************************************** Rep 10 ****************************************
+:rep10
+copy "%VERZ%\SYSTEM ENABLEADDONS1.bat" "\\%Rechnername%\c$\windows\system32\SYSTEM ENABLEADDONS1.bat"
+psexec \\%Rechnername% -s "SYSTEM ENABLEADDONS1.bat" -f
+
+::Loeschen
+del "\\%Rechnername%\c$\Windows\System32\SYSTEM ENABLEADDONS1.bat"
+goto EOF
+
+
+
+:: **************************************** Rep 11 ****************************************
+:rep11
+robocopy "%VERZ%\pkg\Config4.6" "\\%Rechnername%\c$\Temp\Config4.6" /mir
+psexec -s \\%Rechnername% "c:\Temp\Config4.6\_Install.cmd"
+goto EOF
+
+
+:FEHLER
+color 04
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Rechner nicht erreichbar ********
+echo *******************************************************************************
+echo *******************************************************************************
+pause
+color 07
+cls
+goto startnew
+
+:: ***************************************************************************************
+:EOF
+if "%errorlevel%"=="0" color 02 & goto farbegesetzt
+if "%errorlevel%"=="1" color 0C & goto farbegesetztF
+if "%errorlevel%"=="2" color 0C & goto farbegesetztF
+
+
+:farbegesetzt
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Installation abgeschlossen ********
+echo *******************************************************************************
+echo *******************************************************************************
+pause
+color 07
+cls
+goto startnew
+
+:farbegesetztF
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Installation FEHLER ********
+echo *******************************************************************************
+echo *******************************************************************************
+pause
+color 07
+cls
+goto startnew
\ No newline at end of file
diff --git a/Java Tool/Java.reg b/Java Tool/Java.reg
new file mode 100644
index 0000000..84dd126
Binary files /dev/null and b/Java Tool/Java.reg differ
diff --git a/Java Tool/Java_1.8.reg b/Java Tool/Java_1.8.reg
new file mode 100644
index 0000000..ade9c59
Binary files /dev/null and b/Java Tool/Java_1.8.reg differ
diff --git a/Java Tool/KB/Policy.msu b/Java Tool/KB/Policy.msu
new file mode 100644
index 0000000..b863e5c
Binary files /dev/null and b/Java Tool/KB/Policy.msu differ
diff --git a/Java Tool/KB/install.bat b/Java Tool/KB/install.bat
new file mode 100644
index 0000000..007a2ed
--- /dev/null
+++ b/Java Tool/KB/install.bat
@@ -0,0 +1 @@
+START /WAIT WUSA c:/temp/policy.msu /quiet
\ No newline at end of file
diff --git a/Java Tool/KEYS.ini b/Java Tool/KEYS.ini
new file mode 100644
index 0000000..807e2f9
--- /dev/null
+++ b/Java Tool/KEYS.ini
@@ -0,0 +1,5 @@
+26A24AE4-039D-4CA4-87B4-
+3248F0A8-6813-11D6-A77B-
+35A3A4F4-B792-11D6-A78A-
+3248F0A8-6813-11D6-A77B-
+7148F0A8-6813-11D6-A77B-
\ No newline at end of file
diff --git a/Java Tool/SYSTEM CLEARJAVA.bat b/Java Tool/SYSTEM CLEARJAVA.bat
new file mode 100644
index 0000000..e66fce8
--- /dev/null
+++ b/Java Tool/SYSTEM CLEARJAVA.bat
@@ -0,0 +1,200 @@
+@echo off
+
+
+::
+
+::Alle Java-Versionen lschen
+
+setlocal enableextensions enabledelayedexpansion
+
+:: x86 key = HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
+:: x64 key = HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
+
+cls
+echo *******************************************************************************
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Java-Uninstaller ********
+echo *******************************************************************************
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Prozesse schliessen ********
+echo *******************************************************************************
+echo *******************************************************************************
+
+echo ******** iexplorer
+Taskkill /F /IM iexplorer.exe /T
+echo ******** iexplore
+Taskkill /F /IM iexplore.exe /T
+echo ******** firefox
+Taskkill /F /IM firefox.exe /T
+echo ******** chrome
+Taskkill /F /IM chrome.exe /T
+echo ******** jusched
+Taskkill /F /IM jusched.exe /T
+echo ******** jqs
+Taskkill /F /IM jqs.exe /T
+echo ******** java
+Taskkill /F /IM java.exe /T
+echo ******** javaw
+Taskkill /F /IM javaw.exe /T
+echo ******** javaws
+Taskkill /F /IM javaws.exe /T
+echo ******** javacpl
+Taskkill /F /IM javacpl.exe /T
+echo ******** jp2launcher
+Taskkill /F /IM jp2launcher.exe /T
+echo ******** ssvagent
+Taskkill /F /IM ssvagent.exe /T
+
+
+echo ******** Citrix
+Taskkill /F /IM Receiver.exe /T
+
+echo ******** Teamviewer / Connect
+Taskkill /F /IM VisFastStart.exe /T
+
+echo ******** WMIC
+Taskkill /F /IM WMIC.exe /T
+
+echo ******** MSI
+Taskkill /F /IM msiexec.exe
+
+timeout /T 3 > nul
+
+echo *******************************************************************************
+echo ******** Java-Versionen werden deinstalliert ********
+echo *******************************************************************************
+echo *******************************************************************************
+
+::Deinstallation aller Java-Produkte
+echo ******** Pruefung auf Audi-Java-Applikationen
+wmic /failfast:on product where "name like '%%Java%%'" call uninstall /nointeractive
+timeout /T 3 > nul
+
+:: Schleife, die sich alle Installationteilkeys aus der Datei "KEYS.TXT" holt und dann deinstalliert, falls etwas nicht erwischt wurde.
+FOR /f %%i in (KEYS.ini) do call :SearchAndDeinstall %%i
+
+timeout /T 1 > nul
+
+echo *******************************************************************************
+echo ******** Entfernen der Registry-Eintraege ********
+echo *******************************************************************************
+echo *******************************************************************************
+timeout /T 1 > nul
+
+::JavaSwitcher
+REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AdvancedOptions\Audi_Java" /f
+REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\AdvancedOptions\Audi_Java" /f
+REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{CAFEEFAC-6666-6666-6666-ABCDEFFEDCBA}" /f
+REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{08B0E5C0-4FCB-11CF-AAA5-00401C608501}\TreatAs" /f
+
+timeout /T 1 > nul
+echo *******************************************************************************
+::Policy
+REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft" /f
+REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft" /f
+
+timeout /T 3 > nul
+::User-spezifische Eintrge auch lschen
+@setlocal
+
+set "RegPath=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList"
+set "SID="
+
+for /f "delims=" %%i in ('reg query "%RegPath%"^|findstr /ibc:"%RegPath%\S-"') do (
+ echo %%~nxi & REG DELETE "HKU\%%~nxi\SOFTWARE\AppDataLow\Software\JavaSoft" /f
+)
+for /f "delims=" %%i in ('reg query "%RegPath%"^|findstr /ibc:"%RegPath%\S-"') do (
+ echo %%~nxi & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jnlp" /f
+)
+
+timeout /T 1 > nul
+
+echo *******************************************************************************
+echo ******** Loeschen der Restdateien ********
+echo *******************************************************************************
+echo *******************************************************************************
+
+
+echo ******** DLLs
+
+::DLLs
+del c:\Windows\system32\npdeploy*.dll
+del c:\Windows\system32\npjpi170_17.dll
+del c:\Windows\system32\npjpi160_18.dll
+del c:\Windows\system32\npjpi150_22.dll
+del c:\Windows\system32\npjpi142_19.dll
+
+del c:\Windows\system32\java*.exe
+del c:\Windows\system32\*java.exe
+del c:\Windows\system32\*java*.exe
+
+del c:\Windows\syswow64\npdeploy*.dll
+del c:\Windows\syswow64\npjpi170_17.dll
+del c:\Windows\syswow64\npjpi160_18.dll
+del c:\Windows\syswow64\npjpi150_22.dll
+del c:\Windows\syswow64\npjpi142_19.dll
+
+del c:\Windows\syswow64\*java.exe
+del c:\Windows\syswow64\java*.exe
+del c:\Windows\syswow64\*java*.exe
+
+echo ******** Programmordner
+::Programmordner
+rd /s /q "c:\Programme\Java"
+rd /s /q "C:\Program Files (x86)\Java"
+::Java Switcher Ordner lschen
+rd /s /q "C:\Program Files\Audi\JavaSwitcher"
+rd /s /q "C:\Program Files (x86)\Audi\JavaSwitcher"
+
+::Java Ordner unter windows
+echo ******** Java unter Windows
+rd /s /q "c:\windows\Sun"
+
+timeout /T 1 > nul
+echo ******** Alle Sun-Ordner unter Users
+::Alle Sun-Ordner unter den Nutzern und anschlieend lschen
+c:
+cd c:\users
+for /f "delims=" %%a in ('dir /ad /b /s "Sun"') do echo "%%a" & rd /s /q "%%a"
+
+timeout /T 1 > nul
+
+echo *******************************************************************************
+echo ******** Ueberschreiben der JAVA_OPTIONS ********
+echo *******************************************************************************
+echo *******************************************************************************
+set JAVA_OPTIONS=
+set _JAVA_OPTIONS=
+::set _JAVA_OPTIONS=-Xmx512M
+
+echo *******************************************************************************
+echo ******** Anpassen Reg-Keys ********
+echo *******************************************************************************
+echo *******************************************************************************
+REG DELETE "HKEY_CLASSES_ROOT\JNLPFile\Shell\Open\Command" /f
+REG ADD "HKEY_CLASSES_ROOT\JNLPFile\Shell\Open\Command" /d "\"c:\Program Files\Java\jre7\bin\javaws.exe \"%1\"" /f
+REG DELETE "HKEY_CLASSES_ROOT\jarfile\Shell\Open\Command" /f
+REG ADD "HKEY_CLASSES_ROOT\jarfile\Shell\Open\Command" /d "\"c:\Program Files\Java\jre7\bin\javaws.exe \"%1\"" /f
+
+::reg add "HKLM\SOFTWARE\ApplicationPacks\JavaAP" /v "AP_Audi_Oracle_Java_7u67_Global_NTR_91" /t reg_dword /d "0" /f
+
+:EOF
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Deinstallation abgeschlossen ********
+echo *******************************************************************************
+echo *******************************************************************************
+exit
+
+:SearchAndDeinstall
+For /F "Tokens=6* delims=\" %%I In ('Reg Query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall 2^>NUL ^|Findstr /I /C:"{%1"') Do (
+ echo %%J & MsiExec.exe /qn /x %%J /norestart
+)
+For /F "Tokens=7* delims=\" %%I In ('Reg Query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall 2^>NUL ^|Findstr /I /C:"{%1"') Do (
+ echo %%J & MsiExec.exe /qn /x %%J /norestart
+)
+
+
+
\ No newline at end of file
diff --git a/Java Tool/SYSTEM DISABLEADDONS.bat b/Java Tool/SYSTEM DISABLEADDONS.bat
new file mode 100644
index 0000000..7793bd9
--- /dev/null
+++ b/Java Tool/SYSTEM DISABLEADDONS.bat
@@ -0,0 +1,61 @@
+@echo off
+::
+
+
+
+echo ******** iexplorer schliessen
+Taskkill /F /IM iexplorer.exe /T 2>NUL
+echo ******** iexplore schliessen
+Taskkill /F /IM iexplore.exe /T 2>NUL
+
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Java Addons ausschalten ********
+echo *******************************************************************************
+echo *******************************************************************************
+
+::User-spezifische Eintrge lschen
+@setlocal
+
+set "RegPath=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList"
+set "SID="
+
+for /f "delims=" %%i in ('reg query "%RegPath%"^|findstr /ibc:"%RegPath%\S-"') do (
+ echo %%~nxi & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{DBC80044-A445-435B-BC74-9C25C1C588A9}" /f & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{761497BB-D6F0-462C-B6EB-D4DAF1D92D43}" /f & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{08B0E5C0-4FCB-11CF-AAA5-00401C608501}" /f & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{E7E6F031-17CE-4C07-BC86-EABFE594F69C}" /f & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{CAFEEFAC-DEC7-0000-0001-ABCDEFFEDCBA}" /f & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{8AD9C840-044E-11D1-B3E9-00805F499D93}" /f)
+
+timeout /T 3 > nul
+
+echo ******** Systemreg fuer Addon hinzufuegen
+::Alte JavaAddons
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {DBC80044-A445-435B-BC74-9C25C1C588A9} /d 0 /f
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {761497BB-D6F0-462C-B6EB-D4DAF1D92D43} /d 0 /f
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {CAFEEFAC-DEC7-0000-0001-ABCDEFFEDCBA} /d 0 /f
+
+timeout /T 3 > nul
+
+::ADOBE
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {E7E6F031-17CE-4C07-BC86-EABFE594F69C} /d 0 /f
+
+timeout /T 1 > nul
+::neues Java-Addon
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {08B0E5C0-4FCB-11CF-AAA5-00401C608501} /d 1 /f
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {8AD9C840-044E-11D1-B3E9-00805F499D93} /d 1 /f
+
+timeout /T 3 > nul
+
+::InternetExplorer ffnen und schlieen
+echo ******** iexplore oeffnen
+start iexplore
+
+timeout /T 7 > nul
+
+echo ******** iexplorer schliessen
+Taskkill /F /IM iexplorer.exe /T 2>NUL
+echo ******** iexplore schliessen
+Taskkill /F /IM iexplore.exe /T 2>NUL
+
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Java Addons ausschalten abgeschlossen ********
+echo *******************************************************************************
+echo *******************************************************************************
diff --git a/Java Tool/SYSTEM ENABLEADDONS.bat b/Java Tool/SYSTEM ENABLEADDONS.bat
new file mode 100644
index 0000000..1faed59
--- /dev/null
+++ b/Java Tool/SYSTEM ENABLEADDONS.bat
@@ -0,0 +1,45 @@
+@echo off
+::
+::
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Java Addons einschalten ********
+echo *******************************************************************************
+echo *******************************************************************************
+
+::User-spezifische Eintrge lschen
+@setlocal
+
+set "RegPath=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList"
+set "SID="
+
+for /f "delims=" %%i in ('reg query "%RegPath%"^|findstr /ibc:"%RegPath%\S-"') do (
+ echo %%~nxi & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{DBC80044-A445-435B-BC74-9C25C1C588A9}" /f & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{761497BB-D6F0-462C-B6EB-D4DAF1D92D43}" /f & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{08B0E5C0-4FCB-11CF-AAA5-00401C608501}" /f
+)
+)
+timeout /T 1 > nul
+
+echo ******** Systemreg fuer Addon hinzufuegen
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {DBC80044-A445-435B-BC74-9C25C1C588A9} /d 1 /f
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {761497BB-D6F0-462C-B6EB-D4DAF1D92D43} /d 1 /f
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {08B0E5C0-4FCB-11CF-AAA5-00401C608501} /d 1 /f
+
+::REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{DBC80044-A445-435B-BC74-9C25C1C588A9}" /f
+::REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{761497BB-D6F0-462C-B6EB-D4DAF1D92D43}" /f
+
+::InternetExplorer ffnen und schlieen
+echo ******** iexplore oeffnen
+start iexplore
+
+timeout /T 7 > nul
+
+echo ******** iexplorer schliessen
+Taskkill /F /IM iexplorer.exe /T 2>NUL
+echo ******** iexplore schliessen
+Taskkill /F /IM iexplore.exe /T 2>NUL
+
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Java Addons einschalten abgeschlossen ********
+echo *******************************************************************************
+echo *******************************************************************************
diff --git a/Java Tool/SYSTEM ENABLEADDONS1.bat b/Java Tool/SYSTEM ENABLEADDONS1.bat
new file mode 100644
index 0000000..2e8cbd2
--- /dev/null
+++ b/Java Tool/SYSTEM ENABLEADDONS1.bat
@@ -0,0 +1,48 @@
+@echo off
+::
+::
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Java Addons ausschalten ********
+echo *******************************************************************************
+echo *******************************************************************************
+
+::User-spezifische Eintrge lschen
+@setlocal
+
+set "RegPath=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList"
+set "SID="
+
+for /f "delims=" %%i in ('reg query "%RegPath%"^|findstr /ibc:"%RegPath%\S-"') do (
+ echo %%~nxi & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{DBC80044-A445-435B-BC74-9C25C1C588A9}" /f & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{761497BB-D6F0-462C-B6EB-D4DAF1D92D43}" /f & REG DELETE "HKU\%%~nxi\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{08B0E5C0-4FCB-11CF-AAA5-00401C608501}" /f
+)
+)
+timeout /T 1 > nul
+
+echo ******** Systemreg fuer Addon hinzufuegen
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {DBC80044-A445-435B-BC74-9C25C1C588A9} /d 1 /f
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {761497BB-D6F0-462C-B6EB-D4DAF1D92D43} /d 1 /f
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Ext\CLSID" /v {08B0E5C0-4FCB-11CF-AAA5-00401C608501} /d 1 /f
+
+::REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{DBC80044-A445-435B-BC74-9C25C1C588A9}" /f
+::REG DELETE "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{761497BB-D6F0-462C-B6EB-D4DAF1D92D43}" /f
+REG add "HKCU\Software\Policies\Microsoft\Internet Explorer\Restrictions" /v NoBrowserOptions /t REG_DWORD /d 0 /f
+REG add "HKLM\Software\Policies\Microsoft\Internet Explorer\Restrictions" /v NoBrowserOptions /t REG_DWORD /d 0 /f
+
+
+::InternetExplorer ffnen und schlieen
+echo ******** iexplore oeffnen
+start iexplore
+
+timeout /T 7 > nul
+
+echo ******** iexplorer schliessen
+Taskkill /F /IM iexplorer.exe /T 2>NUL
+echo ******** iexplore schliessen
+Taskkill /F /IM iexplore.exe /T 2>NUL
+
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Java Addons ausschalten abgeschlossen ********
+echo *******************************************************************************
+echo *******************************************************************************
diff --git a/Java Tool/SYSTEM KILLPROCESSES.bat b/Java Tool/SYSTEM KILLPROCESSES.bat
new file mode 100644
index 0000000..ca21844
--- /dev/null
+++ b/Java Tool/SYSTEM KILLPROCESSES.bat
@@ -0,0 +1,29 @@
+@echo off
+::
+::
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Alle Prozesse schliessen ********
+echo *******************************************************************************
+echo *******************************************************************************
+
+echo ******** iexplorer
+Taskkill /F /IM iexplorer.exe /T 2>NUL
+echo ******** iexplore
+Taskkill /F /IM iexplore.exe /T 2>NUL
+echo ******** firefox
+Taskkill /F /IM firefox.exe /T 2>NUL
+echo ******** chrome
+Taskkill /F /IM chrome.exe /T 2>NUL
+echo ******** jusched
+Taskkill /F /IM jusched.exe /T 2>NUL
+echo ******** jqs
+Taskkill /F /IM jqs.exe /T 2>NUL
+echo ******** java
+Taskkill /F /IM java.exe /T 2>NUL
+
+echo *******************************************************************************
+echo *******************************************************************************
+echo ******** Abgeschlossen ********
+echo *******************************************************************************
+echo *******************************************************************************
\ No newline at end of file
diff --git a/Java Tool/SYSTEM REG JAVAUPDATE APPDATA.bat b/Java Tool/SYSTEM REG JAVAUPDATE APPDATA.bat
new file mode 100644
index 0000000..dc882c8
--- /dev/null
+++ b/Java Tool/SYSTEM REG JAVAUPDATE APPDATA.bat
@@ -0,0 +1,8 @@
+@echo off
+::
+::
+set javaVersion=%1
+echo %javaVersion%
+c:
+cd c:\users
+for /f "delims=" %%a in ('dir /ad /b /s "LocalLow"') do echo "%%a" & robocopy "c:\Temp\%javaVersion%\Sun" "%%a\Sun" /mir
\ No newline at end of file
diff --git a/Java Tool/SYSTEM REG JAVAUPDATE.bat b/Java Tool/SYSTEM REG JAVAUPDATE.bat
new file mode 100644
index 0000000..ae870f2
--- /dev/null
+++ b/Java Tool/SYSTEM REG JAVAUPDATE.bat
@@ -0,0 +1,41 @@
+@echo off
+::
+::
+echo ################################################################################
+echo #### SID-beziehen
+echo ################################################################################
+set "RegPath=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList"
+set "SID="
+c:
+cd users
+for /f "delims=" %%a in ('dir /ad /b "C:\users"') do (call :workWithUser %%a)
+exit
+
+::echo #### Registrieren
+::c:
+::cd\
+::C:\Program Files (x86)\Java\jre1.7.0_17\bin\ssvagent -new
+::C:\Program Files\Java\jre1.7.0_17\bin\ssvagent -new
+::C:\Program Files (x86)\Java\jre1.6.0_38\bin\ssvagent -new
+::C:\Program Files\Java\jre1.6.0_38\bin\ssvagent -new
+
+
+
+:workWithUser
+echo ################################################################################
+echo #### Benutzer: %1
+for /f "delims=" %%i in ('reg query "%RegPath%"^|findstr /ibc:"%RegPath%\S-"') do (
+reg query "%%i" /v "ProfileImagePath"|findstr /iec:"%1" >nul && set "SID=%%~nxi")
+
+
+echo #### SID: %SID%
+echo #### REG-Werte loeschen
+REG DELETE "HKEY_USERS\%SID%\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableAutoUpdateCheck /f
+REG DELETE "HKEY_USERS\%SID%\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /f
+echo #### Fileextensionss
+REG DELETE "HKEY_USERS\%SID%\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jnlp" /f
+REG DELETE "HKEY_USERS\%SID%\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jar" /f
+echo #### REG-Werte einfuegen
+REG ADD "HKEY_USERS\%SID%\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableAutoUpdateCheck /d 0 /f
+REG ADD "HKEY_USERS\%SID%\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /d 0 /f
+
diff --git a/Java Tool/SYSTEM REG JAVAUPDATE1767.bat b/Java Tool/SYSTEM REG JAVAUPDATE1767.bat
new file mode 100644
index 0000000..9bb86d8
--- /dev/null
+++ b/Java Tool/SYSTEM REG JAVAUPDATE1767.bat
@@ -0,0 +1,53 @@
+@echo off
+::
+::
+echo ################################################################################
+echo #### SID-beziehen
+echo ################################################################################
+set "RegPath=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList"
+set "SID="
+c:
+cd users
+for /f "delims=" %%a in ('dir /ad /b "C:\users"') do (call :workWithUser %%a)
+exit
+
+::echo #### Registrieren
+::c:
+::cd\
+::C:\Program Files (x86)\Java\jre1.7.0_17\bin\ssvagent -new
+::C:\Program Files\Java\jre1.7.0_17\bin\ssvagent -new
+::C:\Program Files (x86)\Java\jre1.6.0_38\bin\ssvagent -new
+::C:\Program Files\Java\jre1.6.0_38\bin\ssvagent -new
+
+
+
+:workWithUser
+echo ################################################################################
+echo #### Benutzer: %1
+for /f "delims=" %%i in ('reg query "%RegPath%"^|findstr /ibc:"%RegPath%\S-"') do (
+reg query "%%i" /v "ProfileImagePath"|findstr /iec:"%1" >nul && set "SID=%%~nxi")
+
+
+echo #### SID: %SID%
+echo #### REG-Werte loeschen
+REG DELETE "HKEY_USERS\%SID%\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableAutoUpdateCheck /f
+REG DELETE "HKEY_USERS\%SID%\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /f
+echo #### Fileextensionss
+REG DELETE "HKEY_USERS\%SID%\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jnlp" /f
+REG DELETE "HKEY_USERS\%SID%\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jar" /f
+echo #### REG-Werte einfuegen
+REG ADD "HKEY_USERS\%SID%\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableAutoUpdateCheck /d 0 /f
+REG ADD "HKEY_USERS\%SID%\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /d 0 /f
+
+
+:: Deploymentproperties fr alle User anlegen
+REG ADD "HKEY_USERS\%SID%\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" /v "deployment.expiration.decision.timestamp.10.67.2" /d "1421226831" /f
+REG ADD "HKEY_USERS\%SID%\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" /v "deployment.expiration.decision.suppression.10.67.2" /d "true" /f
+REG ADD "HKEY_USERS\%SID%\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" /v "deployment.version" /d "7.21" /f
+REG ADD "HKEY_USERS\%SID%\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" /v "deployment.javaws.associations" /d "ALWAYS" /f
+REG ADD "HKEY_USERS\%SID%\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" /v "deployment.modified.timestamp" /d "1421396229111" /f
+REG ADD "HKEY_USERS\%SID%\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" /v "deployment.expiration.decision.10.67.2" /d "later" /f
+REG ADD "HKEY_USERS\%SID%\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" /v "deployment.expired.version" /d "10.67.2" /f
+REG ADD "HKEY_USERS\%SID%\Software\AppDataLow\Software\JavaSoft\DeploymentProperties" /v "deployment.javaws.shortcut" /d "ALWAYS" /f
+
+
diff --git a/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/Errorhandling.xml b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/Errorhandling.xml
new file mode 100644
index 0000000..b7c226c
--- /dev/null
+++ b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/Errorhandling.xml
@@ -0,0 +1,85 @@
+
+
+
+
+
+ AudiSysWrapper.exe
+
+
+ Infoblende.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe>
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ VW-Wrapper
+
+
+ MSIEXEC.exe;Wusa.exe
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ Infoblende.exe
+
+
+ Wusa.exe
+
+
+
+
+
+
+ MSIEXEC.exe;*.exe
+
+
+ Wusa.exe
+ install
+
+
+ Wusa.exe
+ uninstall
+
+
+ Wusa.exe>
+ install
+
+
+
\ No newline at end of file
diff --git a/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/Source/Deployment/DeploymentRuleSet.jar b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/Source/Deployment/DeploymentRuleSet.jar
new file mode 100644
index 0000000..2f9cd94
Binary files /dev/null and b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/Source/Deployment/DeploymentRuleSet.jar differ
diff --git a/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/Source/Deployment/cacerts b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/Source/Deployment/cacerts
new file mode 100644
index 0000000..879c0f4
Binary files /dev/null and b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/Source/Deployment/cacerts differ
diff --git a/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Functions.vbs b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Functions.vbs
new file mode 100644
index 0000000..2d52140
--- /dev/null
+++ b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Functions.vbs
@@ -0,0 +1,2493 @@
+Option Explicit
+' Version 1.23
+'For document history look at changelog.docx
+
+'----- Globale Variablen
+Dim WSHShell, FSO, WSHNetwork, InstallDir, Computername, Parameter, LogName, Ret, ACVER, ASAPV, ASAPVER, LockScreenActive
+Dim currentDir, LogDir, ProgramFiles, ProgramFiles64, WinDir, Temp
+Dim DebugMode, LogEnabled
+Dim pName, pVersion, pLang, pRevision
+
+'----- Clients
+Dim ASAP_7 : ASAP_7 = 0
+Dim IDO_32 : IDO_32 = 0
+Dim C_IDO_32 : C_IDO_32 = 0
+Dim ACB_32_O : ACB_32_O = 0
+Dim AC1_32_O : AC1_32_O = 0
+Dim AC2_32_O : AC2_32_O = 0
+Dim C_IDO_64 : C_IDO_64 = 0
+Dim AC2_64_O : AC2_64_O = 0
+Dim AC3_Alpha : AC3_Alpha = 0
+
+Dim AC2_32_N : AC2_32_N = 0
+Dim AC2_64_N : AC2_64_N = 0
+
+Dim AC4_64_O : AC4_64_O = 0
+Dim AC4_64_N : AC4_64_N = 0
+
+'----- Objectdefinitionen
+Set WSHShell = CreateObject("WScript.Shell")
+Set FSO = CreateObject("Scripting.FileSystemObject")
+Set WSHNetwork = WScript.CreateObject("WScript.Network")
+
+'----- Standardvariablen setzen
+Computername = WshNetwork.ComputerName
+If WScript.Arguments.Count=1 Then Parameter=WScript.Arguments(0)
+ASAPV = ReadEnv("ASAPV")
+ACVER = ReadEnv("ACVER")
+ASAPVER = ReadEnv("ASAPVER")
+Temp = ReadEnv("TEMP")
+WinDir = ReadEnv("WINDIR")
+
+If GetOSBit() = 64 Then
+ ProgramFiles = ReadEnv("ProgramFiles(x86)")
+ ProgramFiles64 = ReadEnv("ProgramW6432")
+ If ProgramFiles64 = False Then ProgramFiles64 = ReadEnv("ProgramFiles")
+Else
+ ProgramFiles = ReadEnv("ProgramFiles")
+End If
+
+InstallDir = FSO.GetParentFolderName(WScript.ScriptFullName)
+WSHShell.CurrentDirectory = InstallDir
+currentDir = InstallDir
+
+LogDir = ProgramFiles & "\Audi\InstLogs\"
+LogName = LogDir & pName & "_" & pVersion & "_" & pLang & "_" & pRevision & ".log"
+
+If LCase(Mid(Wscript.FullName, InstrRev(Wscript.FullName,"\")+1)) = "cscript.exe" Then
+ DebugMode = True
+End If
+LogEnabled = True
+
+ReDim errorList0(-1)
+
+'*********************
+'***** FUNCTIONS *****
+'*********************
+
+'----- Active Setup -----
+'Description: Creates a active setup
+'Usage: ActiveSetup , ,
+'Output: n/a
+'Example: ActiveSetup "Programmname","wscript.exe ""c:\windows\sw-source\Programmname\ActiveSetup.vbs"" //B","1"
+'------------------------
+Function ActiveSetup(Name,Pfad,ByVal Version)
+ VbsLog "---------- Execute Active Setup Function: '" & Name & "' '" & Pfad & "' '" & Version & "'"
+ If CheckFolder ("ActiveSetup") Then
+ CreateFolder WinDir & "\SW-Source\" & Name
+ CopyFile "ActiveSetup\*.*", WinDir & "\SW-Source\" & Name & "\"
+ CopyFile ".\_Functions.vbs", WinDir & "\SW-Source\" & Name & "\"
+ End If
+
+ Version = Replace(Version,".",",")
+
+ Ret = WriteReg ("REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & Name & "\", "ActiveSetup " & Name, GetOSBit())
+ WriteReg "REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & Name & "\StubPath", Pfad, GetOSBit()
+ WriteReg "REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & Name & "\Version", Version, GetOSBit()
+
+ If Ret = True Then
+ VbsLog "---------- RESULT ActiveSetup: OK"
+ Else
+ ErrorHandling 1,"---------- RESULT ActiveSetup: ERROR"
+ End If
+End Function
+
+'----- Client Info -----
+'Description: Prints the ClientInfo and sets Client variables
+'Usage: ClientInfo()
+'-----------------------
+Sub ClientInfo()
+ VbsLog "======================================================="
+ VbsLog " ClientInfo:"
+ VbsLog " Name: " & computerName
+ VbsLog " OS-Version: " & GetOSVersion()
+ VbsLog " ACVER: " & ACVER
+ VbsLog " ASAPV: " & ASAPV
+ VbsLog " ASAPVER: " & ASAPVER
+ VbsLog " Client: " & GetClientVersion()
+ VbsLog " Last boot time: " & GetLastBootTime()
+ VbsLog " Reboot required: " & GetRebootStatus()
+ VbsLog " Manufacturer: " & GetHardwareInfo("Manufacturer")
+ VbsLog " Model: " & GetHardwareInfo("Model")
+ VbsLog " Location: " & GetLocation()
+ VbsLog " User: " & GetCurrentUser()
+ VbsLog "======================================================="
+End Sub
+
+'----- Client Check -----
+'Description: Returns the client version, if version is valid; x if invalid
+'Usage: ClientCheck()
+'-----------------------
+Function ClientCheck()
+ Dim strComputer, objWMIService, objItem, colItems
+ Dim systype, objOS
+ Dim clientVersion, i
+ Dim arrClients
+
+ clientVersion = "x"
+
+ If(IDO_32 = 1) Then arrClients = arrClients + "i.Do1.X;"
+ If(C_IDO_32 = 1) Then arrClients = arrClients + "C-i.Do.1.X 32 Bit;"
+ If(C_IDO_64 = 1) Then arrClients = arrClients + "C-i.Do.1.X 64 Bit;"
+ If(ACB_32_O = 1) Then arrClients = arrClients + "AC-B-32-O;"
+ If(AC1_32_O = 1) Then arrClients = arrClients + "AC1-32-O;"
+ If(AC2_32_O = 1) Then arrClients = arrClients + "AC2-32-O;"
+ If(AC2_64_O = 1) Then arrClients = arrClients + "AC2-64-O;"
+ If(AC3_Alpha = 1) Then arrClients = arrClients + "AC3-Alpha;"
+
+ If(AC2_32_N = 1) Then arrClients = arrClients + "AC2-32-N;"
+ If(AC2_64_N = 1) Then arrClients = arrClients + "AC2-64-N;"
+
+ If(ASAP_7 = 1) Then arrClients = arrClients + "ASAP7.X;"
+
+ If(AC4_64_O = 1) Then arrClients = arrClients + "AC4-64-O;"
+ If(AC4_64_N = 1) Then arrClients = arrClients + "AC4-64-N;"
+
+
+ arrClients = Split(arrClients, ";")
+
+ clientVersion = GetClientVersion()
+
+ For i = LBound(arrClients) To UBound(arrClients)-1
+ If arrClients(i) = clientVersion Then
+ ClientCheck = clientVersion
+ Exit Function
+ End If
+ Next
+ ErrorHandling 16010, ""
+ FinishScript()
+End Function
+
+'----- ChangeService -----
+'Description: Change Service startmode or state
+'Usage: ChangeService ,
+'Output: ErrorCode
+'Example: ChangeService "Spooler", "Restart"
+' ChangeService "Spooler", "Disabled"
+'--------------------------------------
+Function ChangeService(ServiceName, StartStop)
+ Dim WantStarted, DesiredState, StartedStopped, ServiceDescr, Result
+ Dim objWMIService, listOfServices, objService, WaitFor
+ Result = 0
+ Select Case LCase(StartStop)
+ Case "start"
+ StartStop = "Start"
+ StartedStopped = "started"
+ WantStarted = True
+ DesiredState = "Running"
+ case "stop"
+ StartStop = "Stop"
+ StartedStopped = "stopped"
+ WantStarted = False
+ DesiredState = "Stopped"
+ Case "manual"
+ StartStop = "Manual"
+ StartedStopped = "stopped"
+ WantStarted = False
+ DesiredState = "Stopped"
+ Case "disabled"
+ StartStop = "Disabled"
+ StartedStopped = "stopped"
+ WantStarted = False
+ DesiredState = "Stopped"
+ Case "automatic", "auto"
+ StartStop = "Auto"
+ StartedStopped = "started"
+ WantStarted = True
+ DesiredState = "Running"
+ Case "restart"
+ ChangeService ServiceName, "stop"
+ ChangeService ServiceName, "start"
+ Exit function
+ Case Else
+ VbsLog " Result: Failed - (Wrond Syntax) in Function:ChangeService"
+ Exit Function
+ End Select
+
+ ' get the service object
+ Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
+ Set listOfServices = objWMIService.ExecQuery("select * from Win32_Service where Name = '" & ServiceName & "'")
+
+ If listOfServices.Count = 0 Then
+ VbsLog "Information | Service '" & ServiceName & "' not found."
+ Else
+ For Each objService In listOfServices
+ ServiceDescr = "The " & objService.Name & " service"
+
+ 'DesiteState = Servicetype & Start or Stop
+ If LCase(DesiredState) = LCase(objService.State) And (LCase(StartStop) = LCase("start") Or LCase(startStop) = LCase("stop")) Then
+ VbsLog "Information | Change Service: " & ServiceDescr & " is already " & objService.State & "."
+ Exit Function
+ End If
+
+ 'StartStop <> Manual & DesiredState = State & StartStop = Servicetyp
+ If LCase(startStop) <> "manual" And LCase(DesiredState)= LCase(objService.State) And LCase(StartStop) = LCase(objService.StartMode) Then
+ VbsLog "Information | Change Service: " & ServiceDescr & " is already " & objService.State & "."
+ Exit Function
+ End If
+
+ ' change service startmode
+ If StartStop = "Disabled" Then
+ Result = objService.changestartmode("disabled")
+ ElseIf StartStop = "Manual" Then
+ Result = objService.changestartmode("manual")
+ ElseIf StartStop = "Auto" Then
+ Result = objService.changestartmode("automatic")
+ End If
+
+ 'change service to manual if disabled and StartMode is start
+ If LCase(StartStop) = lcase("Start") And LCase(objService.StartMode) = lcase("disabled") Then
+ Result = objService.changestartmode("Manual")
+ If Result = 0 Then
+ VbsLog "Information | Change Service: " & ServiceDescr & " changed to manual"
+ Else
+ Errorhandling 1, "Change Service: " & objService.Name
+ End If
+ End If
+
+ ' start or stop service
+ If WantStarted = True Then
+ Result = objService.StartService()
+ Else
+ Result = objService.StopService()
+ End If
+
+ ' display success or failure message
+ Select Case Result
+ Case 0, 5, 10
+ WaitFor = 60000 '60 seconds
+ While WaitFor > 0
+ WScript.Sleep(500) : WaitFor = WaitFor - 500 '0.5 seconds
+ Set objService = objWMIService.Get("Win32_Service.Name='" & ServiceName & "'")
+
+ 'check objService.State / DesiredState (Running/Stopped)
+ If LCase(DesiredState) = LCase(objService.State) Then
+ 'check objService.StartMode / StartStop
+ 'if value StartStop not: start / stop
+ If Not LCase(StartStop) = "start" And Not LCase(StartStop) = "stop" And LCase(objService.startmode) = LCase(StartStop) Then
+ VbsLog "OK | Change Service: " & ServiceDescr & " " & StartedStopped
+ VbsLog "OK | Change Service: " & ServiceDescr & " changed to " & StartStop
+ Exit Function
+ Else
+ VbsLog "OK | Change Service: " & ServiceDescr & " " & StartedStopped
+ If LCase(StartStop) = LCase("Disabled") Then
+ VbsLog "OK | Change Service: " & ServiceDescr & " changed to " & StartStop
+ End If
+ Exit Function
+ End If
+ Else
+ If WaitFor =< 1000 Then VbsLog "ERROR : Failed - in Function:ChangeService"
+ End If
+ Wend
+ Case 2
+ Errorhandling 2, "Change Service: " & ServiceDescr & _
+ " can't be changed because the user did not have the necessary access"
+ Case 3
+ Errorhandling 3, "Change Service: " & ServiceDescr & _
+ " can't be stopped because dependant services are running."
+ Case Else
+ Errorhandling Result, "Change Service: " & ServiceDescr & _
+ " is in state " & objService.State & "."
+ End Select
+ Next
+ ChangeService = Result
+ End If
+End Function
+
+
+'----- Check File -----
+'Description: Returns if file exists
+'Usage: CheckFile
+'Output: True / False
+'Example: CheckFile "c:\temp\text.txt"
+'--------------------------
+Function CheckFile(File)
+ CheckFile = FSO.FileExists(File)
+End Function
+
+'----- Check Folder -----
+'Description: Returns if folder exists
+'Usage: CheckFolder
+'Output: True / False
+'Example: CheckFolder "c:\temp"
+'--------------------------
+Function CheckFolder(Folder)
+ CheckFolder = FSO.FolderExists(Folder)
+End Function
+
+'----- CheckIsLaptop -----
+'Description: Check if client is a Laptop
+'Usage: CheckIsLaptop()
+'Output: True or False
+'Example: CheckIsLaptop()
+'-------------------------
+Function CheckIsLaptop()
+ Dim strComputer, objWMIService, colItems, objItem
+ strComputer = "."
+ On Error Resume Next
+ Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/cimv2" )
+ Set colItems = objWMIService.ExecQuery( "Select * from Win32_Battery", , 48 )
+ CheckIsLaptop = False
+ For Each objItem in colItems
+ CheckIsLaptop = True
+ Next
+ If Err Then Err.Clear
+ On Error Goto 0
+End Function
+
+'----- Check Process -----
+'Description: Checks if process(es) is/are running
+'Usage: CheckProc
+'Output: True / False
+'Example: CheckProc "ccmexec.exe,windword.exe"
+'--------------------------
+Function CheckProc(strProcess)
+ Dim process,v,i
+
+ CheckProc = False
+ v=Split(strProcess,",")
+ For i=0 To UBound(v)
+ For Each process In GetObject("winmgmts://.").InstancesOf("win32_process")
+ If UCase(Process.name) = UCase(Trim(v(i))) Then
+ CheckProc = True
+ Exit Function
+ End If
+ Next
+ Next
+End Function
+
+'----- Check if Product installed -----
+'Description: Checks if a Product is installed
+'Usage: CheckProduct
+'Output: TRUE if Product is installed
+'Example: CheckProduct "{B332732A-4958-41DD-B439-DDA2D32753C5}"
+'--------------------------------------
+Function CheckProduct(ProductCode)
+ Dim objInstaller
+
+ Set objInstaller = WScript.CreateObject("WindowsInstaller.Installer")
+ ret = objInstaller.ProductState(ProductCode)
+ If ret = 5 Then
+ VbsLog "Installed: " & objInstaller.ProductInfo(ProductCode, "ProductName") & " (" & objInstaller.ProductInfo(ProductCode, "Publisher") & ") V" & objInstaller.ProductInfo(ProductCode, "VersionString")
+ CheckProduct = True
+ Else
+ VbsLog "Product is NOT installed (" & ProductCode & ")"
+ CheckProduct = False
+ End If
+End Function
+
+'----- Runs commandline and logs into logfile -----
+'Description: Runs a commandline and logs its output into the logfile
+'Usage: CommandWithOutput ,
+'Output: Exitcode
+'Example: CommandWithOutput "cmd /c dir c:\","0"
+'--------------------------------------
+Function CommandWithOutput(Command,Abbruch)
+ Dim output,objWSH_Exec,i,v
+ Const WSHRunning = &H0
+
+ VbsLog "Execute CommandWithOutput Function: '" & Command & "' '" & Abbruch & "'"
+ VbsLog "==========> Start CMD Command Output <=========="
+
+ WshShell.CurrentDirectory = InstallDir
+ Set objWSH_Exec = WshShell.Exec(command)
+
+ With objWSH_Exec
+ Do While .Status = WSHRunning
+ Do Until objWSH_Exec.StdOut.AtEndOfStream
+ output = objWSH_Exec.StdOut.ReadLine
+ VbsLog Trim(output)
+ Loop
+ Loop
+
+ Ret = objWSH_Exec.ExitCode
+ CommandWithOutput = Ret
+
+ VbsLog "==========> End CMD Command Output <=========="
+
+ If Abbruch = "" Then
+ VbsLog "+ RESULT CommandWithOutput: OK | Accepting all ExitCodes [" & Ret & "]"
+ Else
+ v=Split(Abbruch,",")
+ For i = LBound(v) To UBound(v)
+ If StrComp(Ret,v(i)) = 0 Then
+ VbsLog "+ RESULT CommandWithOutput: OK | Accepted ExitCode (" & v(i) & ", " & ErrorText(Ret) & " )"
+ Exit Function
+ End If
+ Next
+ VbsLog "+ RESULT CommandWithOutput: ERROR | ExitCode (" & Ret & ", " & ErrorText(Ret) & " )"
+ ErrorHandling Ret,ErrorText(Ret)
+ FinishScript()
+ End If
+ End With
+End Function
+
+'----- Copy File -----
+'Description: Copies File(s)
+'Usage: CopyFile ,
+'Output: True / False
+'Example: CopyFile "text.txt", "c:\temp\"
+' CopyFile "text.txt", "c:\temp\newtext.txt"
+'--------------------------
+Function CopyFile(Source,ByVal Dest)
+ Dim FSO
+ Set FSO = CreateObject("Scripting.FileSystemObject")
+ On Error Resume Next
+ FSO.CopyFile Source, Dest, True
+
+ If Err.Number = 70 Then
+ If Right(Dest, 1) = "\" And InStr(Source, "*") = 0 Then
+ If InStr(Source, "\") <> 0 Then
+ Dest = Dest & Right(Source,Len(Source) - InStrRev(Source, "\"))
+ Else
+ Dest = Dest & Source
+ End If
+ End If
+ Err.Clear
+ Ret = FSO.GetFile(Dest).Attributes
+ FSO.GetFile(Dest).Attributes = 0
+ FSO.CopyFile Source, Dest, True
+ FSO.GetFile(Dest).Attributes = Ret
+ End If
+
+ If Err.Number = 0 Then
+ CopyFile = True
+ VbsLog "OK | File copy: [" & source & "] --> [" & dest & "]"
+ Else
+ CopyFile = False
+ ErrorHandling Err.Number, "File copy: (" & Err.Description & "): [" & source & "] --> [" & dest & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Copy Folder -----
+'Description: Copy Folder(s)
+'Usage: CopyFolder ,
+'Output: True / False
+'Example: CopyFolder "redist", "c:\temp\"
+'-----------------------
+Function CopyFolder(Source,Dest)
+ Dim FSO
+ Set FSO = CreateObject("Scripting.FileSystemObject")
+ On Error Resume Next
+ FSO.CopyFolder Source,Dest,True
+ If Err.Number = 0 Then
+ CopyFolder = True
+ VbsLog "OK | Folder copy [" & source & "] --> [" & dest & "]"
+ Else
+ CopyFolder = False
+ ErrorHandling Err.Number, "Folder copy (" & Err.Description & "): [" & source & "] --> [" & dest & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Copy Folder XCopy -----
+'Description: Copy Folder(s) via XCopy
+'Usage: CopyFolderX ,
+'Output: Returncode of xcopy.exe
+'Example: CopyFolderX "C:\Programme\", "D:\Programme"
+'-----------------------
+Function CopyFolderX(fs, dest)
+ CreateFolder dest
+ CopyFolderX = run ("XCopy","xcopy.exe """ & fs & """ """ & dest & """ /E /R /Y /Q", "")
+End Function
+
+'----- Create Folder -----
+'Description: Create Folder
+'Usage: CreateFolder
+'Output: True / False
+'Example: CreateFolder "c:\temp\newfolder"
+'-------------------------
+Function CreateFolder(ByVal folder)
+ If Right(folder, 1) <> "\" Then folder = folder + "\"
+ Dim fso, pointer, newFolder
+ Set fso = CreateObject("Scripting.FileSystemObject")
+ pointer=0
+ On Error Resume Next
+ If FSO.FolderExists(Folder) = True Then
+ VbsLog "Information | Function CreateFolder. Folder [" & folder & "] exist."
+ CreateFolder = True
+ On Error Goto 0
+ Exit Function
+ End If
+ Do While pointer < Len(Folder)
+ pointer = InStr(pointer + 1,folder, "\")
+ newFolder = Left(folder, pointer)
+ If Not fso.FolderExists(newFolder) Then FSO.CreateFolder(newFolder)
+ Loop
+ If Err.Number = 0 Then
+ VbsLog "OK | Folder [" & folder & "] created."
+ CreateFolder = True
+ Else
+ ErrorHandling Err.Number, "Folder not created: " & Err.Description
+ CreateFolder = False
+ End If
+ On Error Goto 0
+End Function
+
+'----- Create ShortCut -----
+'Description: Create a shortcut
+'Usage: CreateShortCut , , , ,
+'Output: True / False
+'Example: CreateShortcut "C:\...\Desktop", "ShortCutName", WinDir & "\System32\cmd.exe", "C:\Test.ico, 5", "-c"
+'---------------------------
+Function CreateShortcut(lnkDestPath, ByVal lnkName, lnkTargetPath, IconLocation, lnkArguments) 'Bsp: CreateShortcut AllUsersProfile & "\Desktop", "ShortCutName", WinDir & "\System32\cmd.exe", "C:\Test.ico", "-c"
+ Dim oShellLink, lnkWorkingDirectory
+ Dim f, i, strPath
+ VbsLog "Execute CreateShortcut Function: '" & lnkDestPath & "' '" & lnkName & "' '" & lnkTargetPath & "' '" & IconLocation & "' '" & lnkArguments & "'"
+
+ On Error Resume Next
+ If Not Right(lnkTargetPath, 1) = "\" Then
+ f = Split(lnkTargetPath, "\")
+ If UBound(f) >= 1 Then
+ For i = 0 To UBound(f)-1
+ lnkWorkingDirectory = lnkWorkingDirectory & f(i) & "\"
+ Next
+ End If
+ Else
+ lnkWorkingDirectory = lnkTargetPath
+ End If
+
+ If Not Right(LCase(lnkname),4) = ".lnk" And Not Right(LCase(lnkName),4) = ".url" Then
+ lnkName = lnkName & ".lnk"
+ End If
+
+ If InStr(Right(LCase(IconLocation), 5),", ") = False Then IconLocation = IconLocation & ", 0"
+
+ 'Set WshShell = WScript.CreateObject("WScript.Shell")
+ Set oShellLink = WshShell.CreateShortcut(lnkDestPath & "\" & lnkName)
+ oShellLink.TargetPath = lnkTargetPath
+ 'oShellLink.WindowStyle = 1
+ If Not Right(LCase(lnkName),4) = ".url" Then
+ oShellLink.WorkingDirectory = lnkWorkingDirectory
+ oShellLink.IconLocation = IconLocation
+ oShellLink.Description = "Shortcut"
+ oShellLink.Arguments = lnkArguments
+ End If
+
+ oShellLink.Save
+
+ If Err.Number <> 0 Then
+ ErrorHandling Err.Number, "+ RESULT CreateShortcut: ERROR " & Err.Number & ", " & Err.Description
+ CreateShortcut = False
+ Else
+ VbsLog "+ RESULT CreateShortcut: OK"
+ CreateShortcut = True
+ End If
+
+ On Error Goto 0
+End Function
+
+'----- Create Task -----
+'Description: Creates Task
+'Usage: CreateTask , ,
+'Output: True / False
+'Example: CreateTask "Taskname","c:\temp\name.exe","EINMAL"
+'Parameter: : MINUTE, STNDLICH, TGLICH, MONATLICH, EINMAL, BEIMSTART, BEIANMELDUNG, BEILEERLAUF
+'-----------------------
+Function CreateTask (name, file, plan)
+ On Error Resume Next
+ Dim strArgument
+
+ If Left(GetOSVersion(), 1) > 5 Then strArgument = " /F"
+
+ Ret = WSHShell.Run ("schtasks.exe /create /tn """ & name & """ /tr """ & file & """ /sc " & plan & " /ru SYSTEM" & strArgument, 0, True)
+ If Ret <> 0 Then
+ CreateTask = False
+ ErrorHandling Ret, "ERROR (" & Ret & ") | Task not created: [" & name & "] [" & file & "] [" & plan & "]"
+ Else
+ CreateTask = True
+ VbsLog "OK | Task created: [" & name & "] [" & file & "] [" & plan & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Create Uninstall -----
+'Description: Creates Uninstall
+'Usage: CreateUninstall("")
+'Example: CreateUninstall "MySoftware"
+'----------------------------
+Function CreateUninstall(Name)
+ Dim v, strName, strPublisher, strVersion
+ VbsLog "---------- Execute CreateUninstall Function: '" & Name & "'"
+ v = Split(name, "_")
+ Select Case UBound(v)
+ Case 1,2 : strPublisher = v(0) : strName = v(1) : strVersion = pVersion
+ Case Else
+ v = Empty
+ v = Split(pName, "_")
+ If UBound(v) >= 1 Then
+ strPublisher = v(0) : strName = v(1) : strVersion = pVersion : Name = pName
+ Else
+ strPublisher = pName : strName = pName : strVersion = pVersion : Name = pName
+ End If
+ End Select
+
+ CreateFolder WinDir & "\SW-Source\" & Name
+ CopyFile "_Uninstall.vbs", WinDir & "\SW-Source\" & Name & "\"
+ CopyFile "_Functions.vbs", WinDir & "\SW-Source\" & Name & "\"
+
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\Displayname" ,strName,32
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\DisplayVersion" ,strVersion,32
+ WriteReg "DWORD","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\NoModify" ,1,32
+ WriteReg "DWORD","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\NoRepair" ,1,32
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\Publisher" ,strPublisher,32
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\UninstallString","wscript.exe """ & WINDIR & "\sw-source\" & Name & "\_Uninstall.vbs"" //B",32
+ VbsLog "---------- RESULT CreateUninstall: OK"
+End Function
+
+'----- Delete File -----
+'Description: Deletes File(s)
+'Usage: DeleteFile
+'Output: True / False
+'Example: DeleteFile "c:\temp\text.txt"
+'-----------------------
+Function DeleteFile(File)
+ On Error Resume Next
+ FSO.DeleteFile File, True
+ If Err.Number = 0 Then
+ DeleteFile = True
+ VbsLog "OK | File delete: [" & File & "]"
+ ElseIf Err.Number = 53 Then
+ DeleteFile = False
+ VbsLog "Information | File delete (" & Err.Description & "): [" & File & "]"
+ Else
+ DeleteFile = False
+ ErrorHandling Err.Number, "File delete: (" & Err.Description & ") [" & File & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Delete Folder -----
+'Description: Deletes Folder
+'Usage: DeleteFolder
+'Output: True / False
+'Example: DeleteFolder "c:\temp\test"
+'-----------------------
+Function DeleteFolder(Folder)
+ On Error Resume Next
+ If FSO.FolderExists(Folder) Then
+ FSO.DeleteFolder Folder, True
+
+ If Err.Number = 70 Then
+ Err.Clear
+ FSO.GetFolder(Folder).Attributes = 0
+ FSO.DeleteFolder Folder, True
+ End If
+ If Err.Number = 0 Then
+ DeleteFolder = True
+ VbsLog "OK | Folder delete: [" & Folder & "]"
+ Else
+ DeleteFolder = False
+ ErrorHandling Err.Number, "Folder delete: (" & Err.Description & "): [" & Folder & "]"
+ End If
+ Else
+ DeleteFolder = False
+ VbsLog "Information | Folder delete (Folder don't exist): [" & Folder & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Delete Folder 2 -----
+'Description: Deletes Folder
+'Usage: DeleteFolder2 ,
+'Output: True / False
+'Example: DeleteFolder2 "C:\Temp\Testordner", "1,70"
+'---------------------------
+Function DeleteFolder2(Folder, AcceptedErrNr)
+ Dim ErrNr, i, TempErr, TempErrDesc
+ DeleteFolder2 = False
+ If FSO.FolderExists(Folder) Then
+ On Error Resume Next
+ FSO.DeleteFolder Folder, True
+ TempErr = Err.Number : TempErrDesc = Err.Description
+ On Error Goto 0
+
+ If TempErr = 0 Then
+ DeleteFolder2 = True
+ VbsLog "OK | Folder delete: [" & Folder & "]"
+ Else
+ ErrNr = Split(AcceptedErrNr, ",")
+ If UBound(ErrNr) >= 0 Then
+ For i = LBound(ErrNr) To UBound(ErrNr)
+ If CInt(ErrNr(i)) = CInt(TempErr) Then
+ VbsLog "Information | Folder delete accepted ExitCode (" & TempErr & "): (" & TempErrDesc & "): [" & Folder & "]"
+ Exit Function
+ End If
+ Next
+ End If
+ End If
+ ErrorHandling TempErr, "Folder delete: (" & TempErrDesc & "): [" & Folder & "]"
+ Else
+ VbsLog "Information | Folder delete (Folder don't exist): [" & Folder & "]"
+ End If
+End Function
+
+'----- Delete Registry -----
+'Description: Deletes Registry values, keys
+'Usage: DeleteReg , ,
+'Output: ErrorCode
+'Example: DeleteReg "KEY", "HKLM\Software\Testvalue", 64
+'Parameters: : KEY, VALUE
+'---------------------------
+Function DeleteReg (strRegType, key, hive)
+ Dim strRootKey, strKey, strValueName, objCtx, objLocator, objReg, intReturnCode, rootKey, keys, i, OPName
+
+ keys = Split(key,"\")
+ strRootKey = keys(0)
+ For i = 1 To UBound(keys)
+ strKey = strKey + keys(i) + "\"
+ Next
+ strValueName = keys(UBound(keys))
+
+ Select Case UCase(strRootKey)
+ Case "HKCR", "HKEY_CLASSES_ROOT"
+ rootKey = &h80000000
+ Case "HKCU", "HKEY_CURRENT_USER"
+ rootKey = &h80000001
+ Case "HKLM", "HKEY_LOCAL_MACHINE"
+ rootKey = &h80000002
+ Case "HKU", "HKEY_USERS"
+ rootKey = &h80000003
+ Case "HKCC", "HKEY_CURRENT_CONFIG"
+ rootKey = &h80000005
+ End Select
+
+ Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+ objCtx.Add "__ProviderArchitecture", hive
+ Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
+ Set objReg = objLocator.ConnectServer("", "root\default", "", "", , , , objCtx).Get("StdRegProv")
+
+ If UCase(strRegType) = "KEY" Then
+ OPName = "Delete Key"
+ Dim iRC,SubKeys,sKey
+ iRC = objReg.EnumKey (rootKey, strKey, SubKeys)
+
+ If iRC = 0 Then
+ If Not IsNull(SubKeys) Then
+ For Each sKey In SubKeys
+ DeleteReg "Key",strRootKey & "\" & strKey & sKey, hive
+ Next
+ End If
+ intReturnCode = objReg.DeleteKey (rootKey, strKey)
+ Else
+ intReturnCode = objReg.DeleteKey (rootKey, strKey)
+ End If
+ End If
+
+ If UCase(strRegType) = "VALUE" Then
+ OPName = "Delete Value"
+ strKey = Mid(key, Len(keys(0)) + 2, Len(key) - Len(keys(UBound(keys))) - Len(keys(0)) - 2)
+ strValueName = keys(UBound(keys))
+ intReturnCode = objReg.DeleteValue(rootKey,strKey,strValueName,"")
+ End If
+ DeleteReg = intReturnCode
+ If intReturnCode = 0 Then
+ VbsLog "OK | " & OPName & " [(" & hive & ") " & key & "]"
+ ElseIf intReturnCode = 2 Then
+ VbsLog "Information (" & intReturnCode & ") | " & OPName & ": Value not found [(" & hive & ") " & key & "]"
+ Else
+ ErrorHandling intReturnCode, OPName & ": [(" & hive & ") " & key & "]"
+ End If
+End Function
+
+'----- Delete Task -----
+'Description: Deletes a task
+'Usage: DeleteTask
+'Output: True / False
+'Example: DeleteTask "Testtask"
+'---------------------------
+Function DeleteTask(name)
+ On Error Resume Next
+ If Left(GetOSVersion(), 1) < 6 Then
+ ReDim arrTaskName(-1)
+ Dim oExec, x, i, output
+
+ Set oExec = WshShell.Exec("cmd /C schtasks.exe /Query /nh /fo csv")
+
+ Ret = 1
+ Do Until oExec.StdOut.AtEndOfStream
+ output = oExec.StdOut.ReadLine
+ If Len(output) > 1 And InStr(1, output, ",",1) <> 0 then
+ x = Split(output, ",")
+ ReDim preserve arrTaskName(Ubound(arrTaskName) + 1)
+ arrTaskName(UBound(arrTaskName)) = x(0)
+ End If
+ Loop
+
+ For i = LBound(Arrtaskname) To UBound(arrTaskName)
+ If LCase(Replace(arrTaskName(i),"""", "")) = LCase(name) Then
+ Ret = 0
+ End If
+ Next
+ Else
+ Ret = WSHShell.Run ("schtasks.exe /Query /TN """ & name & """", 0, True)
+ End If
+
+ If Ret <> 0 Then
+ VbsLog "Information | Delete Task (Task don't exist) [" & name & "]"
+ DeleteTask = False : Err.Clear
+ Exit Function
+ End If
+ Ret = WSHShell.Run ("schtasks.exe /Delete /TN """ & name & """ /f", 0, True)
+ If ret <> 0 Then
+ DeleteTask = False
+ ErrorHandling ret, "Task delete: [" & name & "]"
+ Else
+ DeleteTask = True
+ VbsLog "OK | Task delete: [" & name & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Delete Uninstall -----
+'Description: Deletes Uninstall
+'Usage: DeleteUninstall("")
+'Example: DeleteUninstall "MySoftware"
+'----------------------------
+Function DeleteUninstall(Name)
+ If Name = "" Then Name = pName
+ DeleteReg "KEY","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name,32
+End Function
+
+'----- ErrorHandling -----
+' Function: ErrorHandling
+' Input: errorCode
+' Description: Collects error codes
+'**********************************************************************
+Sub ErrorHandling(errorCode,errorDescription)
+ If InStr(errorCode, "0") = 1 Then Exit Sub
+ If errorDescription = Empty Then ErrorDescription = ErrorText(errorCode)
+ VbsLog "ERROR (" & errorCode & ") | " & ErrorDescription
+ ReDim preserve errorList0(Ubound(errorList0) + 1)
+ errorList0(UBound(errorList0)) = errorCode
+End Sub
+
+'----- ErrorText -----
+'Description: Returns Errortext
+'Usage: ErrorText
+'Example: ErrorName = ErrorText (3010)
+'---------------------------
+Function ErrorText(number)
+ If CheckFile("ErrorHandling.xml") Then
+ ErrorText = XMLErrordescription(number)
+ If ErrorText = "" Then ErrorText = ""
+ Else
+ Select Case number
+ Case "0" ErrorText="OK"
+ Case "1" ErrorText="Unspecific error occured"
+ Case "999" ErrorText="User info screen canceled by user."
+ Case "1601" ErrorText="The Windows Installer service could not be accessed."
+ Case "1603" ErrorText="Fatal error during installation."
+ Case "1605" ErrorText="This action is only valid for products that are currently installed."
+ Case "1618" ErrorText="Another installation is already in progress."
+ Case "1619" ErrorText="This installation package could not be opened."
+ Case "1624" ErrorText="Error applying transforms."
+ Case "1641" ErrorText="The installer has started a reboot."
+ Case "1642" ErrorText="The installer cannot install the upgrade patch because the program being upgraded may be missing, or the upgrade patch updates a different version of the program."
+ Case "3010" ErrorText="A restart is required to complete the install."
+ Case "5100" ErrorText="Restart required before installation can start."
+ Case "16010" ErrorText="Audi Client not supported."
+ Case Else ErrorText=""
+ End Select
+ End If
+End Function
+
+'----- Finish Script -----
+'Description: Script-Finish-Wrapper
+'Usage: FinishScript()
+'Example: FinishScript()
+'---------------------------
+Function FinishScript()
+ Dim errorItem, failed, v, strFinish
+ failed = 0
+ VbsLog "======================================================="
+ For Each errorItem In errorList0
+ VbsLog "= ERROR: " & errorItem
+ If failed = 0 Then
+ failed = errorItem
+ Else
+ failed = 1
+ End If
+ Next
+
+ strFinish = "Installation"
+ If InStr(UCase(WScript.ScriptName),"UNINSTALL") > 0 Then
+ strFinish = "Deinstallation"
+ End If
+
+ If failed <> 0 Or Err <> 0 Then
+ VbsLog "= " & pName & " " & pVersion & " " & strFinish & " FAILED"
+ VbsLog "======================================================="
+ WScript.Quit(failed)
+ Else
+ VbsLog "= " & pName & " " & pVersion & " " & strFinish & " SUCCEEDED"
+ VbsLog "======================================================="
+ WScript.Quit(0)
+ End If
+End Function
+
+'----- FreeSpace Script -----
+'Description: Free Space on Drive
+'Usage: FreeSpace
+'Example: FreeSpace "c:"
+'Returns: Free space in MB
+'---------------------------
+Function FreeSpace(drv)
+ Dim drive,fso
+ Set fso = CreateObject("Scripting.FileSystemObject")
+ Set drive = fso.GetDrive(drv)
+ FreeSpace = Round(drive.FreeSpace/1024/1024)
+End Function
+
+'----- Get Client Version -----
+'Description: Returns the Audi-Client-Version
+'Usage: GetClientVersion()
+'Output: ClientVersion
+'Example: ClientVersion = GetClientVersion()
+'------------------------------
+Function GetClientVersion()
+ Dim clientVersion : clientVersion = "unknown"
+
+ If GetOSBit() = 64 And Left(GetOSVersion(), 3) = "6.3" Then
+ clientVersion = "AC3-Alpha"
+ GetClientVersion = clientVersion
+ Exit Function
+ End If
+
+ If ACVER = Empty Then
+ GetClientVersion = "unknown"
+ Exit Function
+ End If
+
+ Select Case Mid(ACVER, 3, 2)
+ Case 99 : clientVersion = "ASAP6.X"
+ Case 98 : clientVersion = "ASAP7.X"
+ Case 97 : clientVersion = "i.Do1.X"
+ Case 96 : clientVersion = "C-i.Do.1.X 32 Bit"
+ Case 95 : clientVersion = "C-i.Do.1.X 64 Bit"
+ Case 94 : clientVersion = "AC1-32-O"
+ Case 93 : clientVersion = "MED-V auf Basis AC-B-32-N"
+
+ Case 11 : clientVersion = "AC4-64-N"
+ Case 10 : clientVersion = "AC4-64-O"
+
+ Case 06 : clientVersion = "AC-B-32-N"
+ Case 05 : clientVersion = "AC-B-32-O"
+ Case 04 : clientVersion = "AC2-64-N"
+ Case 03 : clientVersion = "AC2-64-O"
+ Case 02 : clientVersion = "AC2-32-N"
+ Case 01 : clientVersion = "AC2-32-O"
+ case else : clientVersion = "unknown"
+ End Select
+
+ GetClientVersion = clientVersion
+End Function
+
+'----- Get Current User -----
+'Description: Returns if the currently logged on user
+'Usage: GetCurrentUser()
+'Output: Domain\User
+'Example: CurrentUser = GetCurrentUser()
+'----------------------------
+Function GetCurrentUser()
+ Dim strComputer, objWMIService, colItems, objItem
+ Dim tempLastUseTime, tempSID
+ On Error Resume Next
+ strComputer = "."
+ GetCurrentUser = ""
+
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ GetCurrentUser = objItem.UserName
+ Next
+ On Error Goto 0
+End Function
+
+'----- Get Current User SID -----
+'Description: Returns the SID of the currently logged on user
+'Usage: GetCurrentUserSID()
+'Output: SID
+'Example: CurrentUserSID = GetCurrentUserSID()
+'--------------------------------
+Function GetCurrentUserSID()
+ Dim strComputer, objWMIService, colItems, objItem
+ Dim tempLastUseTime, tempSID
+ On Error Resume Next
+ strComputer = "."
+ GetCurrentUserSID = ""
+ tempSID = ""
+
+ ' Part 1 (1st Try)
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT * FROM Win32_UserProfile WHERE Loaded = 1 And Special = 0",,48)
+ For Each objItem In colItems
+ If Left(objItem.SID, 8) = "S-1-5-21" And Not Left(Right(objItem.SID, 4), 1) = "-" Then
+ If objItem.LastUseTime > tempLastUseTime Then
+ tempLastUseTime = objItem.LastUseTime
+ GetCurrentUserSID = objItem.SID
+ tempSID = objItem.SID
+ End If
+ End If
+ Next
+ Err.Clear
+
+ If Len(tempSID) > 0 Then
+ GetCurrentUserSID = tempSID
+ On Error Goto 0
+ Exit Function
+ End If
+
+ ' Part 2 (2nd Try)
+ Dim user, objAccount
+
+ Set colItems = objWMIService.ExecQuery("Select UserName from Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ user = Split(objItem.UserName, "\")
+ Next
+
+ If UBound(user) > 0 Then
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT * FROM Win32_UserAccount WHERE Name='" + user(1) + " And Domain='" + user(0) + "'",,48)
+
+ Set objAccount = objWMIService.Get("Win32_UserAccount.Name='" & user(1) & _
+ "',Domain='" & User(0) & "'")
+ tempSID = objAccount.SID
+
+ If Len(tempSID) > 0 Then
+ GetCurrentUserSID = tempSID
+ On Error Goto 0
+ Exit Function
+ End If
+ End If
+
+ ' Part 3 (3rd Try)
+ Dim oReg : Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
+ Dim subKey, arrSubKeys
+ oReg.EnumKey &H80000003, "", arrSubKeys
+
+ For Each subKey In arrSubKeys
+ If Left(subKey, 8) = "S-1-5-21" And InStr(subKey, "Classes") = 0 And Not Left(Right(subKey, 4), 1) = "-" Then
+ tempSID = subKey
+ End If
+ Next
+
+ GetCurrentUserSID = tempSID
+ On Error Goto 0
+End Function
+
+'----- Get File Version -----
+'Description: Determines the version of a file
+'Usage: GetFileVersion()
+'Output: FileVersion
+'Example: FileVersion = GetFileVersion "file.exe"
+'----------------------------
+Function GetFileVersion(file)
+ If Not FSO.FileExists(file) Then
+ VbsLog "Information | Version of File: " + file + " : NOT FOUND"
+ GetFileVersion = "0"
+ Exit Function
+ End If
+ GetFileVersion = FSO.GetFileVersion(file)
+ VbsLog "Version of File: " + file + " : " + GetFileVersion
+End Function
+
+'----- GetHardwareInfo -----
+'Description: Reads Hardware Info
+'Usage: GetHardwareInfo(Type)
+'Output: Desired Value
+'Example: Manufacturer = GetHardwareInfo "Manufacturer"
+'----------------------------
+Function GetHardwareInfo(text)
+ Dim objWMIService,colItems,objItem
+ Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
+ For Each objItem In colItems
+ If UCase(text) = "MANUFACTURER" Then GetHardwareInfo = objItem.Manufacturer
+ If UCase(text) = "MODEL" Then GetHardwareInfo = objItem.Model
+ Next
+End Function
+
+'----- Get Language -----
+'Description: Determines the client language
+'Usage: GetLanguage()
+'Output: DE/HU/EN/FR/IT/ES
+'Example: Language = GetLanguage()
+'------------------------
+Function GetLanguage()
+ Dim langID
+ langId = GetRegKeyValue("REG_SZ", "HKLM\SYSTEM\CurrentControlSet\Control\Nls\Language\Default", GetOSBit())
+ Select Case UCase(Right(langId,2))
+ Case "0E"
+ GetLanguage = "HU"
+ Case "07"
+ GetLanguage = "DE"
+ Case "09"
+ GetLanguage = "EN"
+ Case "0C"
+ GetLanguage = "FR"
+ Case "10"
+ GetLanguage = "IT"
+ Case "0A"
+ GetLanguage = "ES"
+ Case Else
+ VbsLog "Error | Function: GetLanguage [Language unknown]"
+ GetLanguage = "unknown"
+ End Select
+End Function
+
+'----- Get LastBootTime -----
+'Description: Returns boot date and time
+'Usage: GetLastBootTime()
+'Output: Boot date and time
+'Example: GetLastBootTime()
+'------------------------
+Function GetLastBootTime()
+ Dim objOperatingSystem, strComputer
+ Dim objSWbemDateTime, objWMIService, colOperatingSystems
+
+ Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime")
+
+ strComputer = "."
+
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
+ Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
+
+ For Each objOperatingSystem in colOperatingSystems
+ objSWbemDateTime.Value = objOperatingSystem.LastBootUpTime
+ GetLastBootTime = objSWbemDateTime.GetVarDate(True)
+ Next
+
+ Dim HoursSince,DaysSince,strOut
+ HoursSince = DateDiff("h",GetLastBootTime,Now())
+ If HoursSince>24 Then
+ DaysSince=Int(HoursSince/24)
+ strOut = DaysSince & "d " & HoursSince Mod 24 & "h"
+ Else
+ strOut = HoursSince & "h"
+ End If
+
+ GetLastBootTime = GetLastBootTime & " (" & strOut & ")"
+End Function
+
+'----- Get Location -----
+'Description: Determines the client location
+'Usage: GetLocation()
+'Output: IN/NE/GY/BX/SJ
+'Example: Location = GetLocation()
+'------------------------
+Function GetLocation()
+ Dim strComputername,oTSEnv,strSiteCode,oSMSClient
+
+ GetLocation = "unknown" 'default
+ strSiteCode = ""
+
+' Detecting Location
+ On Error Resume Next
+ Set oTSEnv = CreateObject("Microsoft.SMS.TSEnvironment")
+
+ If Err.Number = 0 Then
+' Determine SCCM site and computer name by OSD variables
+ strComputername = Ucase(oTSEnv("OSDComputerName"))
+ strSiteCode = Ucase(oTSEnv("_SMSTSSiteCode"))
+ Else
+ Err.Clear
+ Set oSMSClient = CreateObject("Microsoft.SMS.Client")
+ If Err.Number = 0 Then
+' Determine SCCM site by clients assigned site
+ strComputername = Computername
+ strSiteCode = UCase(oSMSClient.GetAssignedSite)
+ End If
+ Set oSMSClient = Nothing
+ End If
+ Set oTSEnv = Nothing
+ Err.Clear
+
+ If strSiteCode = Empty Then
+ Set oSMSClient = CreateObject("Microsoft.SMS.Client")
+ If Err.Number = 0 Then
+' Determine SCCM site by clients assigned site
+ strSiteCode = UCase(oSMSClient.GetAssignedSite)
+ Set oSMSClient = Nothing
+ End If
+ End If
+
+ On Error Goto 0
+
+' Determine SCCM site code
+ Select Case UCase(strSiteCode)
+ Case "IN0","IN1","INT","PI0","PI1","IA0","IA1"
+ GetLocation = "IN"
+ Case "NE0","NE1","NET","PN0","PN1"
+ GetLocation = "NE"
+ Case "GY0","GY1","PG0","PG1"
+ GetLocation = "GY"
+ Case "BX0","BX1","PB0","PB1"
+ GetLocation = "BX"
+ Case "PS0","SJ1","PJ1"
+ GetLocation = "SJ"
+ Case Else
+' Determine Location by ACVER
+ If ACVER <> False Then
+ Select Case Mid(ACVer,9,1)
+ Case 1 : GetLocation = "GY" : Exit Function
+ Case 2 : GetLocation = "BX" : Exit Function
+ Case 3 : GetLocation = "SJ" : Exit Function
+ End Select
+ Else
+ 'ACVER not found.
+ End If
+
+' Determine Location by Computername
+ Select Case UCase(Mid(strComputerName,5,2))
+ Case "IN"
+ GetLocation = "IN"
+ Case "NE"
+ GetLocation = "NE"
+ Case "BX"
+ GetLocation = "BX"
+ Case "GY"
+ GetLocation = "GY"
+ Case "SJ"
+ GetLocation = "SJ"
+ Case Else
+' Could not determine location. Location = unknown
+ End Select
+ End Select
+End Function
+
+'----- GetOSBit -----
+'Description: Returns the bitsystem
+'Usage: GetOSBit()
+'Output: 32 / 64
+'Example: OSBit = GetOSBit()
+'--------------------
+Function GetOSBit()
+ Dim strComputer, objWMIService, objItem, colItems
+
+ strComputer = "."
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT SystemType FROM Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ If (objItem.SystemType = "x64-based PC") Then
+ GetOSBit = 64
+ Else
+ GetOSBit = 32
+ End If
+ Next
+End Function
+
+'----- GetOSVersion -----
+'Description: Returns the Windows-OS-Version
+'Usage: GetOSVersion()
+'Output: OS Version
+'Example: OSVersion = GetOSVersion()
+'------------------------
+Function GetOSVersion()
+ Dim strComputer, objWMIService, objItem, colItems
+
+ strComputer = "."
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT Version FROM Win32_OperatingSystem",,48)
+ For Each objItem In colItems
+ GetOSVersion = objItem.Version
+ Next
+End Function
+
+'----- Check for Pending Reboots -----
+'Description: Returns the status of pending reboots
+'Usage: GetRebootStatus()
+'Output: Reboot source / False
+'Example: GetRebootStatus()
+'------------------------
+Function GetRebootStatus()
+ Dim sRebootNeeded, localdummy, localPFROarr, localErg, iHive
+ Dim objWMIService, colItems, objItem
+ Dim objWUSysInfo, objRegint, objAgentInfo
+ Dim oCtx, oLocator
+ Const HKEY_LOCAL_MACHINE = &H80000002
+ sRebootNeeded = False
+
+ Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT SystemType FROM Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ If (objItem.SystemType = "x64-based PC") Then
+ iHive = 64
+ Else
+ iHive = 32
+ End If
+ Next
+
+ 'VbsLog "Information | Checking Windows Update..."
+ Set objWUSysInfo = CreateObject("Microsoft.Update.SystemInfo")
+ If objWUSysInfo.RebootRequired Then
+ sRebootNeeded = "Windows Update"
+ End If
+ Set objWUSysInfo = Nothing
+
+ Set oCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+ oCtx.Add "__ProviderArchitecture", iHive
+ Set oLocator = CreateObject("Wbemscripting.SWbemLocator")
+
+ 'VbsLog "Information | Checking Component Based Servicing (CBS)..."
+ Set objRegint = oLocator.ConnectServer("", "root\default", "", "", , , , oCtx).Get("StdRegProv")
+ localErg = objRegint.EnumKey(HKEY_LOCAL_MACHINE,"Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending", localdummy)
+ If (localErg = 0) And (Err.Number = 0) Then
+ If sRebootNeeded <> False Then
+ sRebootNeeded = sRebootNeeded & " | Component Based Servicing"
+ Else
+ sRebootNeeded = "Component Based Servicing"
+ End If
+ End If
+ Set objRegInt = Nothing
+
+ 'VbsLog "Information | Checking Pending File Rename Operations..."
+ Set objRegint = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
+ LocalErg = objRegInt.GetMultiStringValue(HKEY_LOCAL_MACHINE,"SYSTEM\CurrentControlSet\Control\Session Manager","PendingFileRenameOperations", localPFROarr)
+ If (LocalErg = 0) And (Err.Number = 0) Then
+ If sRebootNeeded <> False Then
+ sRebootNeeded = sRebootNeeded & " | PendingFileRenameOperations"
+ Else
+ sRebootNeeded = "PendingFileRenameOperations"
+ End If
+ End If
+ Set objRegInt = Nothing
+
+ If sRebootNeeded = False Then sRebootNeeded = "No"
+ GetRebootStatus = sRebootNeeded
+End Function
+
+'----- Get RegKey Value -----
+'Description: Determines the value of a RegValue
+'Usage: GetRegKeyValue , ,
+'Output: Value
+'Example: Value = GetRegKeyValue ("REG_SZ", "HKLM\Software\AudiAG\MeinTest\MeinKey", 32)
+'Parameters: : REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ, REG_DWORD, REG_QWORD, REG_BINARY
+' : 32, 64
+'----------------------------
+Function GetRegKeyValue(keyType, key, hive)
+ Dim oCtx, oLocator, oReg, oInParams, oOutParams
+ Dim hk, r, i, path, operation
+ Dim strValue, strTemp
+
+ Set oCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+
+ If (hive = 32 Or hive = 64) Then oCtx.Add "__ProviderArchitecture", hive
+
+ Set oLocator = CreateObject("Wbemscripting.SWbemLocator")
+ Set oReg = oLocator.ConnectServer("", "root\default", "", "", , , , oCtx).Get("StdRegProv")
+
+ r = Split(key, "\")
+ r(0) = UCase(r(0))
+ If r(0) = "HKEY_CLASSES_ROOT" Or r(0) = "HKCR" Then
+ hk = &H80000000
+ ElseIf r(0) = "HKEY_CURRENT_USER" Or r(0) = "HKCU" Then
+ hk = &H80000001
+ ElseIf r(0) = "HKEY_LOCAL_MACHINE" Or r(0) = "HKLM" Then
+ hk = &H80000002
+ ElseIf r(0) = "HKEY_USERS" Or r(0) = "HKU" Then
+ hk = &H80000003
+ End If
+
+ path = Mid(key, Len(r(0)) + 2, Len(key) - Len(r(UBound(r))) - Len(r(0)) - 2)
+
+ If Left(UCase(keyType),4) <> "REG_" Then keyType = "REG_" + keyType
+ Select Case UCase(keyType)
+ Case "REG_SZ" : operation = "GetStringValue"
+ Case "REG_EXPAND_SZ" : operation = "GetExpandedStringValue"
+ Case "REG_MULTI_SZ" : operation = "GetMultiStringValue"
+ Case "REG_DWORD" : operation = "GetDWORDValue"
+ Case "REG_QWORD" : operation = "GetQWORDValue"
+ Case "REG_BINARY" : operation = "GetBinaryValue"
+ case Else : ErrorHandling 16000, "Function GetRegKeyValue: Unknown keytype"
+ End Select
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+
+ Select Case UCase(keyType)
+ Case "REG_SZ", "REG_EXPAND_SZ"
+ GetRegKeyValue = oOutParams.sValue
+ Case "REG_MULTI_SZ"
+ If Not IsNull(oOutParams.sValue) Then GetRegKeyValue = Join(oOutParams.sValue, "|")
+ Case "REG_BINARY"
+ For Each strValue in oOutParams.uvalue
+ If len (Hex(strValue)) < 2 Then
+ strValue = "0" & Hex(strValue)
+ Else
+ strValue = Hex(strValue)
+ End If
+ strTemp = strTemp & strValue & "|"
+ Next
+ If Right(strTemp, 1) = "|" Then strTemp = Left(strTemp, Len(strTemp) - 1)
+ GetRegKeyValue = strTemp
+ Case "REG_DWORD", "REG_QWORD"
+ GetRegKeyValue = oOutParams.uValue
+ End Select
+End Function
+
+'----- Get SCCMSiteCode -----
+'Description: Show the SCCM-Site-Code
+'Usage: GetSCCMSiteCode()
+'Output: SiteCode or "unknown"
+'----------------------------
+Function GetSCCMSiteCode()
+ On Error Resume Next
+ Dim oClient
+ Set oClient = CreateObject("Microsoft.SMS.Client")
+ If Err.Number <> 0 then
+ VbsLog "ERROR | Could not create SMS Client Object."
+ GetSCCMSiteCode = "unknown"
+ Else
+ GetSCCMSiteCode = UCase(oClient.GetAssignedSite)
+ End if
+ On Error Goto 0
+End Function
+
+'----- GetScriptArchitecture() -----
+' Description: Returns the script is run as 32 or 64Bit
+' Input: n/a
+' Output: 32 / 64 / unknown
+' Example: GetScriptArchitecture()
+' Author(s): AL
+' Last Edit: 02.05.2014
+'----------------------------
+Function GetScriptArchitecture()
+ Dim objFSO, WSHShell, EnvProc
+ Set objFSO = WScript.CreateObject("Scripting.Filesystemobject")
+ Set WshShell = WScript.CreateObject("WScript.Shell")
+ Set EnvProc = WSHShell.Environment("PROCESS")
+
+ Dim strComputer, objWMIService, objItem, colItems, iOS
+
+ strComputer = "."
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery("SELECT SystemType FROM Win32_ComputerSystem",,48)
+ For Each objItem in colItems
+ If (objItem.SystemType = "x64-based PC") Then
+ iOS = 64
+ Else
+ iOS = 32
+ End If
+ Next
+ If iOS = 64 Then
+ If objFSO.FolderExists(EnvProc("winDir")) Then
+ If objFSO.FolderExists(EnvProc("winDir") & "\Sysnative") Then
+ GetScriptArchitecture = 32
+ Else
+ GetScriptArchitecture = 64
+ End If
+ Else
+ GetScriptArchitecture = "unknown"
+ End If
+ Else
+ GetScriptArchitecture = 32
+ End If
+End Function
+
+'----- Get Userlanguage -----
+'Description: Show the Userlanguage
+'Usage: GetUserLanguage()
+'Output: "DE", "HU", "EN", "FR", "ES", "IT", "unknown"
+'----------------------------
+Function GetUserLanguage()
+ If Left(GetOSVersion(),1) < 6 Then
+ Dim strTempLanguage
+ strTempLanguage = GetRegKeyValue("REG_SZ", "HKCU\Control Panel\Desktop\MUILanguagePending", 32)
+ If IsNull(strTempLanguage) Then
+ VbsLog "Information: RegKey not found 'HKCU\Control Panel\Desktop\MUILanguagePending'. Userlanguage is Clientlanguage"
+ strTempLanguage = GetLanguage()
+ End If
+ Select Case strTempLanguage
+ Case "00000407", "DE" 'Deutsch
+ GetUserLanguage = "DE"
+ Case "0000040e", "HU" 'Ungarisch
+ GetUserLanguage = "HU"
+ Case "00000409", "EN" 'Englisch
+ GetUserLanguage = "EN"
+ Case "0000040c", "FR" 'Franzsisch
+ GetUserLanguage = "FR"
+ Case "00000c0a", "ES" 'Spanisch
+ GetUserLanguage = "ES"
+ Case "00000410", "IT" 'Italienisch
+ GetUserLanguage = "IT"
+ Case Else
+ GetUserLanguage = "unknown"
+ End Select
+ Else
+ Select Case LCase(GetRegKeyValue("REG_MULTI_SZ", "HKCU\Control Panel\Desktop\PreferredUILanguages", 32))
+ Case "de-de"
+ GetUserLanguage = "DE"
+ Case "hu-hu"
+ GetUserLanguage = "HU"
+ Case "us-us", "en-us"
+ GetUserLanguage = "EN"
+ Case "fr-fr"
+ GetUserLanguage = "FR"
+ Case "es-es"
+ GetUserLanguage = "ES"
+ Case "it-it"
+ GetUserLanguage = "IT"
+ Case Else
+ GetUserLanguage = "unknown"
+ End Select
+ End If
+ VbsLog "Userlanguage: " & GetUserLanguage
+End Function
+
+'----- Infoblende -----
+'Description: Shows InfoPanel when no tasksequence is running
+'Usage: InfoBlende "xmlfile.xml"
+'Example: InfoBlende "" or InfoBlende "info.xml"
+'Returns: True if panel was shown, False if not
+'------------------------------
+Function InfoBlende(XML)
+ If CheckProc("TsBootShell.exe,TsmBootstrap.exe,TSManager.exe,TSProgressUI.exe,SMSBoot.exe") = True Then
+ VbsLog "Information | OSD-Installation or tasksequence is running. Panel skipped."
+ InfoBlende = False
+ Exit Function
+ End If
+
+ If XML = "" Then
+ run "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe","0"
+ Else
+ run "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe """ & XML & """","0"
+ End If
+
+ InfoBlende = True
+End Function
+
+'----- Infoblendenowait -----
+'Description: Shows InfoPanel when no tasksequence is running
+'Usage: Infoblendenowait "xmlfile.xml"
+'Example: Infoblendenowait "" or Infoblendenowait "info.xml"
+'Returns: True if panel was shown, False if not
+'------------------------------
+Function InfoBlendeNoWait(XML)
+ If CheckProc("TsBootShell.exe,TsmBootstrap.exe,TSManager.exe,TSProgressUI.exe,SMSBoot.exe") = True Then
+ VbsLog "Information | OSD-Installation or tasksequence is running. Panel skipped."
+ InfoBlendeNoWait = False
+ Exit Function
+ End If
+
+ If XML = "" Then
+ RunNoWait "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe"
+ Else
+ RunNoWait "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe """ & XML & """"
+ End If
+
+ InfoBlendeNoWait = True
+End Function
+
+'----- InstallCertificate -----
+'Description: Install certificates from folder "CertificateFolder"
+'Usage: InstallCertificate , ,
+'Example: InstallCertificate "C:\...\Certificates", "TrustedPublisher", False
+'Parameter: : "Root", "TrustedPublisher"
+'------------------------------
+Sub InstallCertificate(CertificateFolder, StoreLocation, IncludeSubFolders)
+ Dim colFiles, objFile, objFolder
+
+ 'Prft, ob die Datei "CertMgr.exe" im Ordner oder Unterorder enthalten ist
+ 'Wenn diese nicht vorhanden ist, wird das Script beendet
+ Dim objWSH_Exec, outLine, strCertMgr
+ Const WSHRunning = &H0
+
+ strCertMgr = False
+ Set objWSH_Exec = WSHShell.Exec ("cmd.exe /c dir """ & currentDir & """ /s /b")
+ 'Wait for shell to be terminated
+ With objWSH_Exec
+ Do While Not objWSH_Exec.StdOut.AtEndOfStream
+ outLine = Trim(objWSH_Exec.StdOut.ReadLine)
+ If InStr(1, LCase(outLine), LCase("CertMgr.Exe"),0) Then
+ strCertMgr = outLine
+ End If
+ Loop
+ End With
+ If strCertMgr = False Then
+ ErrorHandling 1627, "InstallCertificate: CertMgr.exe ist not in the package"
+ FinishScript()
+ End If
+
+ Set objFolder = FSO.GetFolder(CertificateFolder)
+
+ Set colFiles = objFolder.Files
+ For Each objFile In colFiles
+ Select Case LCase(Right(objFile.Name,4))
+ Case ".cer"
+ run "Install Certificate","""" & strCertMgr & """ -add """ & objFile.Path & """ -s -r localMachine " & StoreLocation, ""
+ Case ".p7b"
+ run "Install Certificate","""" & strCertMgr & """ -add -all """ & objFile.Path & """ -s -r localMachine " & StoreLocation, ""
+ End Select
+ Next
+
+ If IncludeSubfolders = True Then
+ Dim SubFolder
+ For Each SubFolder In objFolder.SubFolders
+ InstallCertificate SubFolder, StoreLocation, True
+ Next
+ End If
+End Sub
+
+'----- InstallDrivers -----
+'Description: Install all drivers in "DriversPath" Folder
+'Usage: InstallDrivers ,
+'Example: InstallDrivers "c:\...\Drivers", True
+'--------------------------
+Sub InstallDrivers(DriversPath, IncludeSubfolders)
+ Dim colFiles, objFile, objFolder, SubFolder, strDevconExe
+ Dim objWSH_Exec, outLine
+ Const WSHRunning = &H0
+
+ If Not Right(DriversPath, 1) = "\" Then DriversPath = DriversPath & "\"
+
+ Set objFolder = FSO.GetFolder(DriversPath)
+ Set colFiles = objFolder.Files
+
+ 'Find Devcon (only XP)
+ If Left(GetOSVersion(),1) < "6" Then
+ If Not(InStr(IncludeSubFolders, Currentdir)) And IncludeSubfolders = True Or IncludeSubfolders = False Then
+ Set objWSH_Exec = WSHShell.Exec ("cmd.exe /c dir """ & currentDir & """ /s /b")
+ 'Wait for shell to be terminated
+ With objWSH_Exec
+ Do While Not objWSH_Exec.StdOut.AtEndOfStream
+ outLine = Trim(objWSH_Exec.StdOut.ReadLine)
+ If InStr(1, LCase(outLine), LCase("devcon.exe"),0) Or InStr(1, LCase(outLine), LCase("devcon_" & GetOSBit() & ".exe"),0) Then
+ strDevconExe = outLine
+ End If
+ Loop
+ End With
+ Else
+ strDevconExe = IncludeSubfolders
+ End If
+ If strDevconExe = "" Then
+ ErrorHandling 1627, "InstallDrivers: ERROR: Devcon.exe ist not in the package"
+ FinishScript()
+ End If
+
+ If Not IncludeSubfolders = False Then
+ IncludeSubfolders = strDevconExe
+ End If
+ End If
+
+ For Each objFile In colFiles
+ If LCase(Right(objFile.Name, 4)) = ".inf" Then
+ Select Case Left(GetOSVersion(), 1)
+ Case 5
+ If strDevconExe = False Or strDevconExe = "" Then
+ ErrorHandling 1627, "InstallDrivers: Devcon.exe ist not in the package"
+ FinishScript()
+ End If
+
+ If Not IncludeSubfolders = False Then
+ IncludeSubfolders = strDevconExe
+ End If
+ run "Driver","""" & strDevconExe & """ dp_add """ & objFile.Path & """", "0,1"
+ Case 6
+ If GetOSBit() = 32 Then
+ run "Driver","pnputil.exe -i -a """ & objFile.Path & """", "0,259"
+ Else
+ 'OperatingSystem x64 > XP
+ If FSO.FileExists(WinDir & "\System32\pnputil.exe") Then
+ run "Driver","""" & WinDir & "\System32\pnputil.exe"" -i -a """ & objFile.Path & """", "0,259"
+ Else
+ run "Driver","""" & WinDir & "\sysnative\pnputil.exe"" -i -a """ & objFile.Path & """", "0,259"
+ End If
+ End If
+ End Select
+ End If
+ Next
+
+ 'Install Drivers from Subfolders if "IncludeSubfolders = True"
+ If Not IncludeSubfolders = False Then
+ Set objFolder = FSO.GetFolder(DriversPath)
+ For Each SubFolder In objFolder.SubFolders
+ InstallDrivers SubFolder.Path, IncludeSubfolders
+ Next
+ End If
+End Sub
+
+'----- Kill Process(es) -----
+'Description: Kills Processes
+'Usage: KillProc
+'Example: KillProc "outlook.exe,word.exe"
+'----------------------------
+Sub KillProc(proc)
+ Dim colProcess,objProcess,objWMIService,v,i,colProcess2
+ Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
+ v=Split(proc,",")
+ For i = 0 To UBound(v)
+ v(i) = Trim(v(i))
+ Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = '" & v(i) & "'")
+ If colProcess.Count = 0 Then vbslog "Information | Prozess [" & v(i) & "] nicht aktiv!"
+ For Each objProcess In colProcess
+ On Error Resume Next
+ Ret = objProcess.Terminate()
+ On Error Goto 0
+ WScript.Sleep (2000)
+ If Ret = 0 Then
+ vbslog "OK | Process [" & v(i) & "] successfull killed"
+ Else
+ ErrorHandling 1, "Process [" & v(i) & "] could not be killed"
+ End If
+ Ret = empty
+ Next
+ Next
+End Sub
+
+'----- PanelWait -----
+'Description: Repeats Info Panel x times until Process ist closed
+'Usage: PanelWait , ,
+'Output: TRUE if Process was closed, FALSE if Process is still running
+'Example: PanelWait "notepad.exe",300,3
+'---------------------
+Function PanelWait(process,timewait,rep)
+ Dim Count : Count = 0
+
+ VbsLog "---------- Execute PanelWait Function: '" & process & "' '" & timewait & "' '" & rep & "'"
+ PanelWait = True
+ If CheckProc("TsBootShell.exe,TsmBootstrap.exe,TSManager.exe,TSProgressUI.exe,SMSBoot.exe") = True Then
+ VbsLog "Information | OSD-Installation or tasksequence is running. Panel skipped."
+ Exit Function
+ End If
+
+ Do While (rep>0) And (CheckProc(process))
+ run "Blende SCCM","Infoblende\AudiSysWrapper.exe Infoblende.exe /w","0"
+ Do While (Count<(timewait/10)) And CheckProc(process) = True
+ WScript.Sleep(10000)
+ Count = Count + 1
+ Loop
+ rep = rep - 1
+ Count = 0
+ Loop
+ If CheckProc(process) = True Then PanelWait = False
+ VbsLog "---------- RESULT PanelWait: " & PanelWait
+End Function
+
+'----- PatchInstalled -----
+'Description: Check Hotfix or Security Update is installed
+'Usage: PatchInstalled
+'Output: True or False
+'Example: PatchInstalled "KB2510636"
+'-------------------------
+Function PatchInstalled(Patch)
+ On Error Resume Next
+ Dim objSession, objSearcher, intHistorycount, colHistory, objEntry, HotFixKB
+
+ Set objSession = CreateObject("Microsoft.Update.Session")
+ Set objSearcher = objSession.CreateUpdateSearcher
+ intHistoryCount = objSearcher.GetTotalHistoryCount
+
+ Set colHistory = objSearcher.QueryHistory(0, intHistoryCount)
+ If Err.Number <> 0 Then
+ VbsLog "Error (" & Err.Number & ") | Function: Patchinstalled (" & Patch & ")"
+ On Error Goto 0
+ Exit Function
+ End If
+ On Error Goto 0
+
+ For Each objEntry in colHistory
+ If InStr(1, objEntry.Title, "(KB", 1) And objEntry.ResultCode = 2 Then
+ HotFixKB = Mid(objEntry.Title, InStr(1,objEntry.Title, "(KB", 1)+1)
+ HotFixKB = Left(HotFixKB, InStr(HotFixKB, ")")-1)
+ If UCase(Patch) = UCase(HotFixKB) Then
+ PatchInstalled = True
+ VbsLog "Information: Patch installed (" & Patch & ")"
+ Exit Function
+ End If
+ End If
+ Next
+ PatchInstalled = False
+ VbsLog "Information: Patch not installed (" & Patch & ")"
+End Function
+
+'----- Reads Environment Variable -----
+'Description: Reads Environment Variable
+'Usage: ReadEnv
+'Example: ret = ReadEnv "WINDIR"
+' FALSE if not readable
+'---------------------------------
+Function ReadEnv(Environ)
+ ReadEnv=WSHShell.ExpandEnvironmentStrings("%" & environ & "%")
+ If Left(ReadEnv,1)="%" Then ReadEnv = False
+End Function
+
+'----- Run Commandline -----
+'Description: Executes a Commandline
+'Usage: run , ,
+'Example: run "Install","msiexec.exe /i prog.msi","0,3010"
+'----------------
+Function Run(Text,Line,Abbruch)
+ Dim ErrCount, ErrOK, I
+ VbsLog "Execute Run Function: '" & Text & "' '" & Line & "' '" & Abbruch & "'"
+ On Error Resume Next
+ Ret = WSHShell.Run (Line, 0, True)
+
+ WSHShell.CurrentDirectory = InstallDir
+
+ ErrOK = False
+ If Abbruch = "" Or Abbruch = False Then ErrOK = True
+ If Text = "" Then Text = "Run"
+ If Ret = Empty Then Ret = Err.Number
+
+ If Ret = 0 Then
+ VbsLog "+ RESULT Run " & Text & ": OK"
+ Else
+ ErrCount = Split(Replace(Abbruch, " ", ""),",")
+ If UBound(ErrCount) >=0 Then
+ For I = LBound(ErrCount) To UBound(ErrCount)
+ If StrComp(ErrCount(I), Ret) = 0 Then
+ VbsLog "+ RESULT Run " & Text & ": OK | Accepted ExitCode (" & Ret & ", " & ErrorText(Ret) & ")"
+ run = Ret
+ On Error Goto 0
+ Exit Function
+ End If
+ Next
+ End If
+
+ If ErrOK = True Then
+ VbsLog "+ RESULT Run " & Text & ": OK | Accepting all ExitCodes"
+ run = Ret
+ On Error Goto 0
+ Exit Function
+ Else
+ ErrorHandling Ret, "+ RESULT Run " & Text & ": ERROR (" & Ret & ", " & ErrorText(Ret) & ")"
+ FinishScript()
+ End If
+ End If
+ On Error Goto 0
+End Function
+
+'----- Run Commandline no wait -----
+'Description: Executes a Commandline without waiting for completion
+'Usage: run ,
+'Example: run "Install","msiexec.exe /i prog.msi"
+'-----------------------------------
+Sub RunNoWait(Text,Line)
+ Dim ErrText, ErrCount, I
+
+ VbsLog "Execute RunNoWait Function: '" & Line & "'"
+
+ On Error Resume Next
+ WSHShell.Run Line, 0, False
+ WSHShell.CurrentDirectory = InstallDir
+
+ If Text = "" Then Text = "Started"
+
+ VbsLog Text & ": " & Line
+
+ On Error Goto 0
+End Sub
+
+'----- Set Environment Variable -----
+'Description: Set Environment Variable
+'Usage: SetEnv , ,
+'Parameter for Operation: SET, ADD, DEL
+'Example: SetEnv "PATH","c:\temp","ADD"
+'-----------------------------------
+Function SetEnv(Environment,Value,Operation)
+ Dim EnvironmentPath, EnvironmentData
+ EnvironmentPath = "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\" & Environment
+ EnvironmentData = GetRegKeyValue( "SZ","HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\" & Environment, GetOSBit())
+
+ If UCase(Operation) = "DEL" Then
+ If Not IsNull(EnvironmentData) Then
+ DeleteReg "VALUE",EnvironmentPath,GetOSBit()
+ Else
+ VbsLog "Information | Delete Environment '" & Environment & "': Was not set."
+ End If
+ ElseIf IsNull(EnvironmentData) Or UCase(Operation) = "SET" Then
+ 'Environment nicht vorhanden
+ VbsLog "OK | Set Environment: '" & Environment & "' to '" & Value & "'"
+ WriteReg "SZ",EnvironmentPath,Value,GetOSBit()
+ ElseIf UCase(Operation) = "ADD" Then
+ 'Environment vorhanden
+ Dim i, x
+ i = Split(Replace(EnvironmentData,";;",";"), ";")
+ For x = LBound(i) To UBound(i)
+ If UCase(i(x)) = UCase(Value) Then
+ VbsLog "Information | Value '" & Value & "' is already in Environment '" & Environment & "'"
+ Exit Function
+ End If
+ Next
+ If Right(EnvironmentData, 1) = ";" Then
+ WriteReg "SZ",EnvironmentPath,EnvironmentData & Value, GetOSBit()
+ Else
+ WriteReg "SZ",EnvironmentPath,EnvironmentData & ";" & Value, GetOSBit()
+ End If
+ VbsLog "OK | Added '" & Value & "' to '" & Environment & "'"
+ End If
+End Function
+
+'----- Uninstall Product -----
+'Description: Uninstall application with if installed
+'Usage: UninstallProduct ,
+'Output Returncode of uninstall if product ist deinstalled, False if product was not installed
+'Example: UninstallProduct "Apple QuickTime","{B332732A-4958-41DD-B439-DDA2D32753C5}"
+'-----------------------------
+Function UninstallProduct(Name,ProductCode)
+ Dim objInstaller
+
+ Const msiInstallStateUnknown = -1 'The product is neither advertised or installed.
+ Set objInstaller = WScript.CreateObject("WindowsInstaller.Installer")
+ If objInstaller.ProductState(ProductCode) <> msiInstallStateUnknown Then
+ VbsLog "Uninstall " & Name & ": " & ProductCode
+ VbsLog "+ ProductName: " & objInstaller.ProductInfo(ProductCode, "ProductName")
+ VbsLog "+ Version: " & objInstaller.ProductInfo(ProductCode, "VersionString")
+ VbsLog "+ Publisher: " & objInstaller.ProductInfo(ProductCode, "Publisher")
+ run "Uninstall","msiexec.exe /x " & ProductCode & " /qn /norestart /le+ """ & LogName & """", "0,1605,3010"
+ UninstallProduct = True
+ Else
+ VbsLog "Information | Uninstall Function:" & Name & " is not installed " & ProductCode
+ UninstallProduct = False
+ End If
+End Function
+
+'----- Unzip File -----
+'Description: Unzip a compressed file
+'Usage: UnzipFile ,
+'Output Returncode of Unzip
+'Example: UnzipFile "test.zip","c:\temp"
+'-----------------------------
+Function UnzipFile(ZipFilePath, DestFolder)
+ Dim strCommand
+
+ strCommand = "7za.exe x -y -o""" & DestFolder & """ """ & ZipFilePath & """"
+
+ VbsLog "Unzip File: " & ZipFilePath
+ VbsLog "+Run: " & strCommand
+ UnzipFile = wshshell.run (strCommand, 0, True)
+ If UnzipFile <> 0 Then
+ Errorhandling UnzipFile, "Failed to extract file :'" & ZipFilePath & "' | Output directory: " & DestFolder
+ FinishScript()
+ Else
+ VbsLog "+OK | File extract :'" & ZipFilePath & "' | Output directory: " & DestFolder
+ End If
+End Function
+
+'----- Write VBSLog -----
+'Description: Writes Line into logfile
+'Usage: VbsLog
+'Example: VbsLog "This is Text"
+'-----------------------------
+Sub VbsLog(LogText)
+ If DebugMode = True Then WScript.Echo (Now & "|" & LogText)
+ If LogEnabled = False Then Exit Sub
+
+ Dim fso, WSHShell, LogFile, pointer, newFolder
+ Set fso = CreateObject("Scripting.FileSystemObject")
+ Set WSHShell = CreateObject("WScript.Shell")
+ '----- Verzeichnis anlegen falls es nicht existiert
+ If fso.FolderExists(LogDir) = False Then
+ CreateFolder(LogDir)
+ End If
+
+ Set LogFile = FSO.OpenTextFile(LogName, 8, True, -1)
+ LogFile.WriteLine Now & "|" & LogText
+ LogFile.Close
+End Sub
+
+'----- Write Registry -----
+'Description: Writes Registry values, keys
+'Usage: WriteReg , , ,
+'Output: Errorcode if failed, True if successfull
+'Example: WriteReg "REG_SZ", "HKLM\Software\Testvalue", "Text", 64
+'Parameters: : REG_SZ, REG_DWORD, REG_BINARY, REG_EXPAND_SZ, REG_MULTI_SZ
+' : 32, 64
+'-------------------------
+Function WriteReg(KeyType, key, value, hive)
+ Dim oCtx, oLocator, oReg, oInParams, oOutParams
+ Dim hk, r, i, path, operation
+ Dim strTemp
+
+ If IsArray(Value) Then
+ VbsLog "Execute WriteReg Function: '" & KeyType & "' '" & Key & "' '" & Join(Value,"|") & "' '" & Hive & "'"
+ Else
+ VbsLog "Execute WriteReg Function: '" & KeyType & "' '" & Key & "' '" & Value & "' '" & Hive & "'"
+ End If
+
+ Set oCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+
+ If (hive = 32 Or hive = 64) Then
+ oCtx.Add "__ProviderArchitecture", hive
+ Else
+ ErrorHandling 2, "WriteReg: Wrong Parameter (Hive)"
+ Exit Function
+ End If
+
+ Set oLocator = CreateObject("Wbemscripting.SWbemLocator")
+ Set oReg = oLocator.ConnectServer("", "root\default", "", "", , , , oCtx).Get("StdRegProv")
+
+ r = Split(key, "\")
+ r(0) = UCase(r(0))
+ If r(0) = "HKEY_CLASSES_ROOT" Or r(0) = "HKCR" Then
+ hk = &H80000000
+ ElseIf r(0) = "HKEY_CURRENT_USER" Or r(0) = "HKCU" Then
+ hk = &H80000001
+ ElseIf r(0) = "HKEY_LOCAL_MACHINE" Or r(0) = "HKLM" Then
+ hk = &H80000002
+ ElseIf r(0) = "HKEY_USERS" Or r(0) = "HKU" Then
+ hk = &H80000003
+ End If
+
+ For i = 1 To UBound(r)-1
+ path = path & r(i) & "\"
+ Set oInParams = oReg.Methods_("CreateKey").InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ Set oOutParams = oReg.ExecMethod_("CreateKey", oInParams, , oCtx)
+ Next
+
+ If UCase(Left(keyType,4)) <> "REG_" Then keyType = "REG_" & keyType
+ Select Case UCase(keyType)
+ Case "REG_SZ"
+ operation = "SetStringValue"
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+ oInParams.sValue = value
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+ Case "REG_DWORD"
+ operation = "SetDWORDValue"
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+ oInParams.uValue = value
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+
+ 'Array(&h00,&h01,&h02,&hff)
+ Case "REG_BINARY"
+ operation = "SetBinaryValue"
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+ oInParams.uValue = value
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+
+ Case "REG_EXPAND_SZ"
+ operation = "SetExpandedStringValue"
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+ oInParams.sValue = value
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+
+ 'Array ("Value 1","Value 2","Value 3")
+ Case "REG_MULTI_SZ"
+ operation = "SetMultiStringValue"
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+ oInParams.sValue = value
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+
+ Case Else
+ ErrorHandling 1, "WriteReg: Wrong Parameter (KeyType)"
+ Exit Function
+ End Select
+
+ ret = oOutParams.ReturnValue
+
+ On Error Resume Next
+ keyType = UCase(keyType)
+
+ Select Case UCase(keyType)
+ Case "REG_SZ","REG_DWORD","REG_EXPAND_SZ"
+ strTemp = "WriteReg: " & key & ", " & CStr(value) & ", " & keyType & ", " & CStr(hive)
+ Case "REG_BINARY"
+ strTemp = "WriteReg: " & key & ", " & Join(value,"|") & ", " & keyType & ", " & CStr(hive)
+ Case "REG_MULTI_SZ"
+ strTemp = "WriteReg: " & key & ", " & Join(value," | ") & ", " & keyType & ", " & CStr(hive)
+ End Select
+
+ On Error Goto 0
+
+ If ret = 0 Then
+ VbsLog "+ RESULT WriteReg: OK"
+ Ret = True
+ Else
+ ErrorHandling ret, "+ RESULT WriteReg: ERROR | (" & ret & ")"
+ End If
+
+ WriteReg = ret
+End Function
+
+'----- ReadINI -----
+'Description: Reads a value from a INI-File
+'Usage: ReadINI ,,
+'Output: Value if found (space if value is blank), False if not,
+'Example: ReadINI "win.ini","Setup","Sample"
+'-------------------------
+Function ReadINI( myFilePath, mySection, myKey )
+ Const ForReading = 1
+ Const ForWriting = 2
+ Const ForAppending = 8
+
+ Dim intEqualPos
+ Dim objFSO, objIniFile
+ Dim strFilePath, strKey, strLeftString, strLine, strSection
+
+ Set objFSO = CreateObject( "Scripting.FileSystemObject" )
+
+ ReadIni = ""
+ strFilePath = Trim( myFilePath )
+ strSection = Trim( mySection )
+ strKey = Trim( myKey )
+
+ If objFSO.FileExists( strFilePath ) Then
+ Set objIniFile = objFSO.OpenTextFile( strFilePath, ForReading, False, -2 )
+ Do While objIniFile.AtEndOfStream = False
+ strLine = Trim( objIniFile.ReadLine )
+
+ ' Check if section is found in the current line
+ If LCase( strLine ) = "[" & LCase( strSection ) & "]" Then
+ strLine = Trim( objIniFile.ReadLine )
+
+ ' Parse lines until the next section is reached
+ Do While Left( strLine, 1 ) <> "["
+ ' Find position of equal sign in the line
+ intEqualPos = InStr( 1, strLine, "=", 1 )
+ If intEqualPos > 0 Then
+ strLeftString = Trim( Left( strLine, intEqualPos - 1 ) )
+ ' Check if item is found in the current line
+ ' Chr(9) = TAB
+ If LCase( Replace(strLeftString, Chr(9), "") ) = LCase( strKey ) Then
+ ReadIni = Trim( Mid( strLine, intEqualPos + 1 ) )
+ ' In case the item exists but value is blank
+ If ReadIni = "" Then
+ ReadIni = " "
+ End If
+ ' Abort loop when item is found
+ Exit Do
+ End If
+ End If
+
+ ' Abort if the end of the INI file is reached
+ If objIniFile.AtEndOfStream Then Exit Do
+
+ ' Continue with next line
+ strLine = Trim( objIniFile.ReadLine )
+ Loop
+ Exit Do
+ End If
+ Loop
+ objIniFile.Close
+ Else
+ ReadINI = False
+ End If
+End Function
+
+'----- WriteINI -----
+'Description: Writes a value to a INI-File
+'Usage: WriteINI ,,,
+'Output: True if set, False if not
+'Example: WriteINI "win.ini","Setup","Sample","Text"
+'Parameters: will be deleted if is ""
+'-------------------------
+Function WriteINI( myFilePath, mySection, myKey, myValue )
+ Const ForReading = 1
+ Const ForWriting = 2
+ Const ForAppending = 8
+
+ Dim blnInSection, blnKeyExists, blnSectionExists, blnWritten
+ Dim intEqualPos
+ Dim objFSO, objNewIni, objOrgIni
+ Dim strFilePath, strFolderPath, strKey, strLeftString
+ Dim strLine, strSection, strTempDir, strTempFile, strValue
+
+ strFilePath = Trim( myFilePath )
+ strSection = Trim( mySection )
+ strKey = Trim( myKey )
+ strValue = Trim( myValue )
+
+ Set objFSO = CreateObject( "Scripting.FileSystemObject" )
+
+ strTempDir = wshShell.ExpandEnvironmentStrings( "%TEMP%" )
+ strTempFile = objFSO.BuildPath( strTempDir, objFSO.GetTempName )
+
+ Set objOrgIni = objFSO.OpenTextFile( strFilePath, ForReading, True, -2 )
+ Set objNewIni = objFSO.CreateTextFile( strTempFile, False, False )
+
+ blnInSection = False
+ blnSectionExists = False
+ ' Check if the specified key already exists
+ blnKeyExists = ( ReadIni( strFilePath, strSection, strKey ) <> "" )
+ blnWritten = False
+
+ ' Check if path to INI file exists, quit if not
+ strFolderPath = Mid( strFilePath, 1, InStrRev( strFilePath, "\" ) )
+ If Not objFSO.FolderExists ( strFolderPath ) Then
+
+ ErrorHandling 1, "Folder of INI-File does not exist"
+ Set objOrgIni = Nothing
+ Set objNewIni = Nothing
+ Set objFSO = Nothing
+ WriteINI = False
+ Exit Function
+ End If
+
+ While objOrgIni.AtEndOfStream = False
+ strLine = Trim( objOrgIni.ReadLine )
+ If blnWritten = False Then
+ If LCase( strLine ) = "[" & LCase( strSection ) & "]" Then
+ blnSectionExists = True
+ blnInSection = True
+ ElseIf InStr( strLine, "[" ) = 1 Then
+ blnInSection = False
+ End If
+ End If
+
+ If blnInSection Then
+ If blnKeyExists Then
+ intEqualPos = InStr( 1, strLine, "=", vbTextCompare )
+ If intEqualPos > 0 Then
+ strLeftString = Trim( Left( strLine, intEqualPos - 1 ) )
+ If LCase( strLeftString ) = LCase( strKey ) Then
+ If strValue <> "" Then
+ VbsLog "OK | Set Value: " & strKey & "=" & strValue & " in [" & strSection & "]"
+ objNewIni.WriteLine strKey & "=" & strValue
+ WriteINI = True
+ End If
+ blnWritten = True
+ blnInSection = False
+ End If
+ End If
+ If Not blnWritten Then
+ objNewIni.WriteLine strLine
+ End If
+ Else
+ objNewIni.WriteLine strLine
+ If strValue <> "" Then
+ VbsLog "OK | New Value: " & strKey & "=" & strValue & " in [" & strSection & "]"
+ objNewIni.WriteLine strKey & "=" & strValue
+ WriteINI = True
+ End If
+ blnWritten = True
+ blnInSection = False
+ End If
+ Else
+ objNewIni.WriteLine strLine
+ End If
+ Wend
+
+ If blnSectionExists = False Then ' section doesn't exist
+ objNewIni.WriteLine
+ VbsLog "OK | New Section: " & "[" & strSection & "]"
+ objNewIni.WriteLine "[" & strSection & "]"
+ If strValue <> "" Then
+ VbsLog "OK | New Value: " & strKey & "=" & strValue
+ objNewIni.WriteLine strKey & "=" & strValue
+ WriteINI = True
+ End If
+ End If
+
+ objOrgIni.Close
+ objNewIni.Close
+
+ ' Delete old INI file
+ objFSO.DeleteFile strFilePath, True
+ ' Rename new INI file
+ objFSO.CopyFile strTempFile, strFilePath
+ objFSO.DeleteFile strTempFile, True
+
+ Set objOrgIni = Nothing
+ Set objNewIni = Nothing
+ Set objFSO = Nothing
+End Function
+
+'----- VersionCheck -----
+'Description: Compares version numbers
+'Usage: VersionCheck ,
+'Output: Position of different version, positiv or negativ value, 0 if no difference
+'Example: VersionCheck "1.2.3","1.2.5"
+' Returns -3, because the first version ist lower at position three
+'------------------------
+Function VersionCheck(a,b)
+Dim Nr1,Nr2,i
+Nr1=split(a,".")
+Nr2=split(b,".")
+
+For i=0 To UBound(Nr1)
+ If i > UBound(Nr2) Then
+ Versioncheck = 0
+ Exit Function
+ End If
+
+ If Int(Nr1(i)) < Int(Nr2(i)) Then
+ Versioncheck = -(i + 1)
+ Exit Function
+ ElseIf Int(Nr1(i)) > Int(Nr2(i)) Then
+ Versioncheck = i + 1
+ Exit Function
+ End If
+ Versioncheck = 0
+Next
+End Function
+
+'----- XMLErrordescription -----
+'Description: Get Errordescription from XML-File
+'Usage: XMLErrordescription
+'Output: XMLErrordescription
+'Example: XMLErrordescription 1603
+'------------------------
+Function XMLErrordescription(ErrorNumber)
+ Dim xmlDoc, xmlNodes
+ Set xmlDoc = CreateObject("Microsoft.XMLDOM")
+
+ xmlDoc.Async = "False"
+ xmlDoc.Load("Errorhandling.xml")
+ For Each xmlNodes In xmlDoc.SelectNodes("//Errorhandling/Errorlist/Error")
+ If Trim(xmlnodes.getAttribute("Errornumber")) = Trim(Errornumber) Then
+ XMLErrordescription = xmlNodes.getAttribute("Description")
+ End If
+ Next
+ For Each xmlNodes In xmlDoc.SelectNodes("//Errorhandling/Successlist/Success")
+ If Trim(xmlnodes.getAttribute("Errornumber")) = Trim(Errornumber) Then
+ XMLErrordescription = xmlNodes.getAttribute("Description")
+ End If
+ Next
+End Function
+
+
+'----- GetOUByComputerName -----
+'Description: Find OU-AD for Computername
+'Usage: GetOUByComputerName(computerName)
+'Output: "OU-Container" or "Not"
+' "OU=CAT,OU=CAT,OU=AUDI AG,dc=audi,dc=vwg"
+'--------------------------------------
+Function GetOUByComputerName(byval computerName)
+
+ Dim namingContext, ldapFilter, ou
+ Dim cn, cmd, rs
+ Dim objRootDSE
+
+ ' Bind RootDSE for Default Namenscontext
+ Set objRootDSE = getobject("LDAP://RootDSE")
+ namingContext = objRootDSE.Get("defaultNamingContext")
+ Set objRootDSE = nothing
+
+ ' Create Computerobjekts
+ ldapFilter = ";(&(objectCategory=Computer)(name=" & computerName & "))" & _
+ ";distinguishedName;subtree"
+
+ ' ADO Query to Database
+ Set cn = createobject("ADODB.Connection")
+ Set cmd = createobject("ADODB.Command")
+
+ cn.open "Provider=ADsDSOObject;"
+ cmd.activeconnection = cn
+ cmd.commandtext = ldapFilter
+
+ set rs = cmd.execute
+
+ If rs.eof <> true and rs.bof <> true then
+ ou = rs(0)
+ ' to: CN=AUDIINXxxxxxxx OU=Computers,OU=IFP822,OU=FP,OU=F,OU=AUDI AG,DC=audi,DC=vwg
+ ' e.g. OU=CAT,OU=CAT,OU=AUDI AG,dc=audi,dc=vwg
+ getOUByComputerName = ou
+ Else
+ getOUByComputerName = "NOT"
+ End if
+
+ rs.close
+ cn.close
+
+End Function
+
+'----- CreateBrandingInformation -----
+Function CreateBrandingInformation(pName, pVersion, pLang, pRevision)
+
+ DIM pNow: pNow = Now
+
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\ProductName" ,pName, 32
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\ProductVerion", pVersion, 32
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\ProductLanguage", pLang, 32
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\Revision", pRevision, 32
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\InstallDate", pNow, 32
+ WriteReg "REG_SZ", regpath& "\" & pBrandingName & "\AES", pAES, 32
+
+End Function
+
+'----- CreateBrandingInformationExt -----
+
+Function CreateBrandingInformationExt(pName, pVersion, pLang, pRevision, pRegpath)
+
+ Dim pNow: pNow = Now
+ Dim pBrandingName : pBrandingName = pName &"_"& pVersion &"_"& pLang &"_"& pRevision
+
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\ProductName" ,pName, 32
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\ProductVerion", pVersion, 32
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\ProductLanguage", pLang, 32
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\Revision", pRevision, 32
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\InstallDate", pNow, 32
+ WriteReg "REG_SZ", pRegpath& "\" & pBrandingName & "\AES", pAES, 32
+
+End Function
+Function CheckLockScreen()
+
+ DIM IsWorkstationLocked
+ Dim wmi : Set wmi = GetObject("winmgmts://" & computername & "/root/cimv2")
+ Dim logonScreenCount : logonScreenCount = wmi.ExecQuery ("SELECT * FROM Win32_Process WHERE Name = 'LogonUI.exe'").Count
+ If logonScreenCount > 0 then
+ LockScreenActive = true
+ vbslog "LockScreen is active"
+ else
+ LockScreenActive = false
+ vbslog "LockScreen is inactive"
+ end if
+
+End Function
+
+Function PanelWait2(process,timewait,rep, xmlFile)
+ Dim Count : Count = 0
+ PanelWait2 = True
+ If CheckProc("TsBootShell.exe,TsmBootstrap.exe,TSManager.exe,TSProgressUI.exe,SMSBoot.exe") = True Then
+ VbsLog "Information | OSD-Installation or tasksequence is running. Panel skipped."
+ Exit Function
+ End If
+ dim CurrentUserSID : CurrentUserSID = GetCurrentUserSID()
+ If CurrentUserSID <> "" then VbsLog "CurrentUserSID | "&CurrentUserSID&""
+ DIM CurrentUser : CurrentUser = GetCurrentUser()
+ If CurrentUser <> "" then
+ VbsLog "CurrentUser | "&CurrentUser&""
+
+ Do While (rep>0) And (CheckProc(process))
+ run "Blende SCCM","Infoblende\AudiSysWrapper.exe Infoblende.exe " & xmlFile & " /w","0"
+ KillProc process
+ Do While (Count<(timewait/10)) And CheckProc(process) = True
+ VbsLog "Process = "&process&""
+ WScript.Sleep(10000)
+ Count = Count + 1
+ Loop
+ rep = rep - 1
+ Count = 0
+ Loop
+ If CheckProc(process) = True Then PanelWait2 = False
+
+ end if
+End Function
diff --git a/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Install.bat b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Install.bat
new file mode 100644
index 0000000..3c8eda0
--- /dev/null
+++ b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Install.bat
@@ -0,0 +1,8 @@
+@echo off
+rem abfrage 32/64?
+set pfad=%windir%\system32
+if exist "%windir%\SysWOW64" set pfad=%windir%\SysWOW64
+
+rem vbs start
+%pfad%\cscript.exe "%~dp0_Install.vbs"
+echo Errorlevel: %ERRORLEVEL%
diff --git a/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Install.vbs b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Install.vbs
new file mode 100644
index 0000000..5e5c0f2
--- /dev/null
+++ b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Install.vbs
@@ -0,0 +1,183 @@
+Option Explicit
+Dim pName, pVersion, pLang, pRevision, pCustomer, pVersionold, pBrandingName, pAES
+
+pName = "Audi_JavaSecurityConfig"
+pVersion = "4.2"
+pVersionold = "4.01"
+pLang = "NTR"
+pRevision = "91"
+pCustomer = "VWG"
+pAES = "AES-1-001680-A"
+pBrandingName = pName &"_"& pVersion &"_"& pLang &"_"& pRevision
+
+'----- Functions.vbs einbinden
+Dim olibfso : Set olibfso = CreateObject("Scripting.FileSystemObject")
+ExecuteGlobal olibfso.OpenTextFile(olibfso.GetParentFolderName(Wscript.ScriptFullName) + "\_Functions.vbs", 1, false).ReadAll
+Set olibfso = nothing
+
+LogEnabled = True
+
+ClientInfo()
+
+'----- Clients (Delete this block if not needed)
+AC1_32_O = 1
+AC2_32_O = 1
+AC2_64_O = 1
+
+AC2_32_N = 1
+AC2_64_N = 1
+
+AC3_Alpha = 1
+AC4_64_N = 1
+AC4_64_O = 1
+
+ClientCheck()
+
+'----- START Installation -----
+Dim TrustWare32 : TrustWare32 = """" & ProgramFiles & "\IT Solution GmbH\trustWare CSP+ v1.1.0.12\32\itcspsrv.exe"""
+Dim TrustWare64 : TrustWare64 = """" & ProgramFiles & "\IT Solution GmbH\trustWare CSP+ v1.1.0.12\64\itcspsrv.exe"""
+
+' Altes Paket entfernen
+
+VbsLog "----- Start Deinstallation " & pName & " " & pVersion
+
+DeleteReg "KEY","HKLM\Software\AudiAG\InstalledProducts\" & pName & "\",32
+DeleteReg "KEY","HKLM\Software\VWG\InstalledProducts\" & pName & "\",32
+
+'Kopieren systemweite deployment.properties
+CreateFolder WinDir & "\Sun\Java\Deployment"
+CopyFile "Source\Deployment\*.*",WinDir & "\Sun\Java\Deployment"
+
+'Disable Java Deployment Expiration Check
+Dim HighestJavaPath : HighestJavaPath = GetHighestJavaPath(ProgramFiles & "\Java")
+If Not IsNull(HighestJavaPath) Then
+ run "Disable Expiration Check","""" & HighestJavaPath & "\bin\javaws"" -userConfig deployment.expiration.check.enabled false",""
+End If
+
+'Kopieren der Zertifikate
+CopyCerts(ProgramFiles & "\Java")
+If GetOSBit()=64 Then CopyCerts(ProgramFiles64 & "\Java")
+
+'Trustware
+If CheckFile(TrustWare32) Then run "CSP+ 32",TrustWare32 & " installjava","0"
+If GetOSBit() = 64 Then
+ If CheckFile(TrustWare64) Then run "CSP+ 64",TrustWare64 & " installjava","0"
+End If
+
+WriteRegInfo "0"
+
+' Notwendiger RegKey fr die permanente Neuinstallations-Mglichkeit sorgt
+'WriteReg "REG_DWORD", "HKLM\Software\ApplicationPacks\JavaConfig", 1, 32
+
+' Ausfhren von C:\PROGRAM FILES\Java\[any Java Runtime]\bin\ssvagent.exe -new
+RunAgent ProgramFiles & "\Java"
+
+' Write Branding
+Dim pBrandingNameOld : pBrandingNameold = pName &"_"& pVersionOld &"_"& pLang &"_"& pRevision
+Dim Regpath : Regpath = "HKLM\Software\"&pCustomer&"\InstalledProducts"
+dim regType : regType = "KEY"
+'DIM pNow: pNow = Now
+DeleteReg regType, regpath &"\"& pBrandingNameOld , 32
+CreateBrandingInformation pName, pVersion, pLang, pRevision
+
+'----- ENDE Installation -----
+FinishScript()
+
+Sub RunAgent(Folder)
+ Dim Dir,SubDir,JavaVer
+ If Not CheckFolder(Folder) Then Exit Sub
+ Set Dir = FSO.GetFolder(Folder)
+
+ For Each SubDir In Dir.SubFolders
+ JavaVer=Null
+ If Left(LCase(SubDir.Name),4)="jre7" Or Left(LCase(SubDir.Name),6)="jre1.7" Then
+ JavaVer="jre7"
+ ElseIf Left(LCase(SubDir.Name),4)="jre8" Or Left(LCase(SubDir.Name),6)="jre1.8" Then
+ JavaVer="jre8"
+ ElseIf Left(LCase(SubDir.Name),4)="jre9" Then
+ JavaVer="jre9"
+ Else
+ VbsLog "Information | '" & SubDir.Path & "' ist unbekannte Java Version"
+ End If
+
+ If Not IsNull(JavaVer) Then
+ VbsLog "Information | '" & SubDir.Path & "' ist " & JavaVer
+
+ If CheckFolder(SubDir.Path & "\bin") Then
+ RunNoWait "Run", SubDir.Path & "\bin\ssvagent.exe -new"
+ End If
+ End If
+Next
+
+
+End Sub
+
+
+Sub CopyCerts(Folder)
+ Dim Dir,SubDir,JavaVer
+ If Not CheckFolder(Folder) Then Exit Sub
+ Set Dir = FSO.GetFolder(Folder)
+
+ For Each SubDir In Dir.SubFolders
+ JavaVer=Null
+ If Left(LCase(SubDir.Name),4)="jre7" Or Left(LCase(SubDir.Name),6)="jre1.7" Then
+ JavaVer="jre7"
+ ElseIf Left(LCase(SubDir.Name),4)="jre8" Or Left(LCase(SubDir.Name),6)="jre1.8" Then
+ JavaVer="jre8"
+ ElseIf Left(LCase(SubDir.Name),4)="jre9" Then
+ JavaVer="jre9"
+ Else
+ VbsLog "Information | '" & SubDir.Path & "' ist unbekannte Java Version"
+ End If
+
+ If Not IsNull(JavaVer) Then
+ VbsLog "Information | '" & SubDir.Path & "' ist " & JavaVer
+ If CheckFolder(SubDir.Path & "\lib\security") Then
+''' !jetzt nach c:\windows\sun\java\deployment
+''' CopyFile "Source\CA-Trusted-Certs_VWG\*.*",SubDir.Path & "\lib\security\"
+ If CheckFolder("Source\JCE_VWG\" & JavaVer) Then
+ CopyFile "Source\JCE_VWG\" & JavaVer & "\*.*",SubDir.Path & "\lib\security\"
+ End If
+ End If
+ End If
+Next
+End Sub
+
+Function GetHighestJavaPath(Folder)
+ Dim Dir,Item,Name,Version,VersionMax,Path
+ VersionMax = 0
+
+ If Not CheckFolder(Folder) Then
+ VbsLog "Kein Java gefunden in '" & Folder & "'"
+ GetHighestJavaPath = Null
+ Exit Function
+ End If
+
+ Set Dir = FSO.GetFolder(Folder)
+ For Each Item In Dir.SubFolders
+ If CheckFile(Item.Path & "\bin\java.exe") Then
+ Version=GetFileVersion(Item.Path & "\bin\java.exe")
+ End If
+ If VersionCheck(VersionMax,Version) < 0 Then
+ VersionMax = Version
+ Path = Item.Path
+ End If
+ Next
+
+ If VersionMax > 0 Then
+ GetHighestJavaPath = Path
+ Else
+ GetHighestJavaPath = Null
+ End If
+End Function
+
+Sub WriteRegInfo(ErrorLevel)
+ Dim RegRoot
+ RegRoot = "HKLM\Software\VWG\InstalledProducts\" & pName
+
+ If UBound(errorList0)>=0 Then
+ WriteReg "SZ",RegRoot & "\ErrorLevel",Join(errorList0,","),32
+ Else
+ WriteReg "SZ",RegRoot & "\ErrorLevel",ErrorLevel,32
+ End If
+End Sub
\ No newline at end of file
diff --git a/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Uninstall.bat b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Uninstall.bat
new file mode 100644
index 0000000..d5cf60a
--- /dev/null
+++ b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Uninstall.bat
@@ -0,0 +1,9 @@
+@echo off
+rem abfrage 32/64?
+set pfad=%windir%\system32
+rem if exist "%windir%\SysWOW64" set pfad=%windir%\SysWOW64
+
+rem vbs start
+%pfad%\cscript.exe "%~dp0_Uninstall.vbs"
+echo Errorlevel: %ERRORLEVEL%
+pause
\ No newline at end of file
diff --git a/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Uninstall.vbs b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Uninstall.vbs
new file mode 100644
index 0000000..01c54fb
--- /dev/null
+++ b/Java Tool/pkg/AUDI_JavaSecurityConfig_ALL_4.2/_Uninstall.vbs
@@ -0,0 +1,26 @@
+Option Explicit
+Dim pName, pVersion, pLang, pRevision
+
+pName = "Audi_JavaSecurityConfig"
+pVersion = "4.01"
+pLang = "NTR"
+pRevision = "91"
+
+'----- Functions.vbs einbinden
+Dim olibfso : Set olibfso = CreateObject("Scripting.FileSystemObject")
+ExecuteGlobal olibfso.OpenTextFile(olibfso.GetParentFolderName(Wscript.ScriptFullName) + "\_Functions.vbs", 1, false).ReadAll
+Set olibfso = nothing
+
+LogEnabled = True
+
+'----- START Uninstallation -----
+
+VbsLog "----- Start Deinstallation " & pName & " " & pVersion
+
+DeleteReg "KEY","HKLM\Software\AudiAG\InstalledProducts\" & pName & "\",32
+DeleteReg "KEY","HKLM\Software\VWG\InstalledProducts\" & pName & "\",32
+
+VbsLog "----- Ende Deinstallation"
+
+'----- ENDE Uninstallation -----
+FinishScript()
diff --git a/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/Errorhandling.xml b/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/Errorhandling.xml
new file mode 100644
index 0000000..3f6290d
--- /dev/null
+++ b/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/Errorhandling.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+ AudiSysWrapper.exe
+
+
+ Infoblende.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe>
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ MSIEXEC.exe
+
+
+ VW-Wrapper
+
+
+ MSIEXEC.exe;Wusa.exe
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ _Install.vbs
+
+
+ Infoblende.exe
+
+
+ Wusa.exe
+
+
+
+
+
+
+ MSIEXEC.exe;*.exe
+
+
+ Wusa.exe
+ install
+
+
+ Wusa.exe
+ uninstall
+
+
+ Wusa.exe>
+ install
+
+
+
\ No newline at end of file
diff --git a/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/InfoBlende/AudiSysWrapper.exe b/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/InfoBlende/AudiSysWrapper.exe
new file mode 100644
index 0000000..83f4ad3
Binary files /dev/null and b/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/InfoBlende/AudiSysWrapper.exe differ
diff --git a/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/InfoBlende/InfoBlende.exe b/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/InfoBlende/InfoBlende.exe
new file mode 100644
index 0000000..bbeed33
Binary files /dev/null and b/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/InfoBlende/InfoBlende.exe differ
diff --git a/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/InfoBlende/config.xml b/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/InfoBlende/config.xml
new file mode 100644
index 0000000..282505a
--- /dev/null
+++ b/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/InfoBlende/config.xml
@@ -0,0 +1,39 @@
+
+
+ 750
+ 600
+ OK
+
+ 0
+ 999
+ 12
+ Installation
+ Deinstallation Oracle Java
+ Sehr geehrte/r Anwender/in,
+
+fr die De-Installation der [b]Oracle Java Runtime [/b]sind die folgenden Informationen zu beachten:
+
+Die folgenden Anwendung mssen im Vorfeld geschlossen werden.
+
+[c=#FF0000] Internet Explorer, Mozilla Firefox und alle Java Applikationen (z.B. HostOnDemand, AVON, etc.)[/c]
+
+
+Nach besttigen mit [b]OK [/b]oder Ablauf des Countdowns werden die genannten Anforderungen automatisch durchgesetzt.
+
+-----------------------------------------------------------------------------------------------------------------------------
+
+Dear users,
+
+Please note the following Information before uninstalling [b]Oracle Java Runtime.[/b]
+
+The following applications should be closed in advance.
+
+[c=#FF0000] Internet Explorer, Mozilla Firefox and all Java applications (e.g. HostOnDemand, AVON, etc.) [/c]
+
+
+After confirming with [b]OK [/b]or the end of the countdown, the above requirements are automatically enforced.
+
+ Justify
+ 14400
+ de
+
\ No newline at end of file
diff --git a/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/_Functions.vbs b/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/_Functions.vbs
new file mode 100644
index 0000000..9e41958
--- /dev/null
+++ b/Java Tool/pkg/AUDI_JavaUninstall_ALL_4.0/_Functions.vbs
@@ -0,0 +1,2686 @@
+'=================================================
+'For document history look at changelog.docx
+'=================================================
+Option Explicit
+
+'----- Globale Variablen
+Dim WSHShell, FSO, WSHNetwork, InstallDir, Computername, Parameter, LogName, Ret, ACVER, ASAPV, ASAPVER, LockScreenActive
+Dim currentDir, LogDir, ProgramFiles, ProgramFiles64, WinDir, Temp
+Dim DebugMode, LogEnabled
+Dim pName, pVersion, pLang, pRevision
+
+'----- Clients
+Dim ASAP_7 : ASAP_7 = 0
+Dim IDO_32 : IDO_32 = 0
+Dim C_IDO_32 : C_IDO_32 = 0
+Dim ACB_32_O : ACB_32_O = 0
+Dim AC1_32_O : AC1_32_O = 0
+Dim AC2_32_O : AC2_32_O = 0
+Dim C_IDO_64 : C_IDO_64 = 0
+Dim AC2_64_O : AC2_64_O = 0
+Dim AC3_Alpha : AC3_Alpha = 0
+
+Dim AC2_32_N : AC2_32_N = 0
+Dim AC2_64_N : AC2_64_N = 0
+
+Dim AC4_64_O : AC4_64_O = 0
+Dim AC4_64_N : AC4_64_N = 0
+
+'----- Objectdefinitionen
+Set WSHShell = CreateObject("WScript.Shell")
+Set FSO = CreateObject("Scripting.FileSystemObject")
+Set WSHNetwork = WScript.CreateObject("WScript.Network")
+
+'----- Standardvariablen setzen
+Computername = WshNetwork.ComputerName
+If WScript.Arguments.Count=1 Then Parameter=WScript.Arguments(0)
+ASAPV = ReadEnv("ASAPV")
+ACVER = ReadEnv("ACVER")
+ASAPVER = ReadEnv("ASAPVER")
+Temp = ReadEnv("TEMP")
+WinDir = ReadEnv("WINDIR")
+
+If GetOSBit() = 64 Then
+ ProgramFiles = ReadEnv("ProgramFiles(x86)")
+ ProgramFiles64 = ReadEnv("ProgramW6432")
+ If ProgramFiles64 = False Then ProgramFiles64 = ReadEnv("ProgramFiles")
+Else
+ ProgramFiles = ReadEnv("ProgramFiles")
+ ProgramFiles64 = ReadEnv("ProgramFiles")
+End If
+
+InstallDir = FSO.GetParentFolderName(WScript.ScriptFullName)
+WSHShell.CurrentDirectory = InstallDir
+currentDir = InstallDir
+
+LogDir = ProgramFiles64 & "\Audi\InstLogs\"
+LogName = LogDir & pName & "_" & pVersion & "_" & pLang & "_" & pRevision & ".log"
+
+If LCase(Mid(Wscript.FullName, InstrRev(Wscript.FullName,"\")+1)) = "cscript.exe" Then
+ DebugMode = True
+End If
+LogEnabled = True
+
+ReDim errorList0(-1)
+
+'*********************
+'***** FUNCTIONS *****
+'*********************
+
+'----- Active Setup -----
+'Description: Creates an active setup
+'Usage: ActiveSetup()
+'Output: n/a
+'------------------------
+Function ActiveSetup()
+ Dim Name : Name = pName & "_" & pVersion & "_" & pLang & "_" & pRevision
+ Dim Pfad : Pfad = "wscript.exe ""c:\windows\sw-source\" & Name & "\ActiveSetup.vbs"" //B"
+ Dim Version : Version = pVersion
+ VbsLog "---------- Execute Active Setup Function: '" & Name & "' '" & Pfad & "' '" & Version & "'"
+ If CheckFolder ("ActiveSetup") Then
+ CreateFolder WinDir & "\SW-Source\" & Name
+ CopyFile "ActiveSetup\*.*", WinDir & "\SW-Source\" & Name & "\"
+ CopyFile ".\_Functions.vbs", WinDir & "\SW-Source\" & Name & "\"
+ End If
+
+ Version = Replace(Version,".",",")
+
+ Ret = WriteReg ("REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & Name & "\", "ActiveSetup " & Name, GetOSBit())
+ WriteReg "REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & Name & "\StubPath", Pfad, GetOSBit()
+ WriteReg "REG_SZ", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & Name & "\Version", Version, GetOSBit()
+
+ If Ret = True Then
+ VbsLog "---------- RESULT ActiveSetup: OK"
+ Else
+ ErrorHandling 1,"---------- RESULT ActiveSetup: ERROR"
+ End If
+End Function
+
+
+'----- Active Setup Remove (for Usage in _Uninstall.vbs) -----
+'Description: Removes an active setup
+'Usage: ActiveSetupRem()
+'Output: n/a
+'------------------------
+Function ActiveSetupRem()
+ Dim Name : Name = pName & "_" & pVersion & "_" & pLang & "_" & pRevision
+ DeleteReg "Key", "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\" & Name, GetOSBit()
+ DeleteFolder WinDir & "\SW-Source\" & Name
+End Function
+
+
+'----- Client Info -----
+'Description: Prints the ClientInfo and sets Client variables
+'Usage: ClientInfo()
+'-----------------------
+Sub ClientInfo()
+ VbsLog "======================================================="
+ VbsLog " ClientInfo:"
+ VbsLog " Name: " & computerName
+ VbsLog " OS-Version: " & GetOSVersion()
+ VbsLog " ACVER: " & ACVER
+ VbsLog " ASAPV: " & ASAPV
+ VbsLog " ASAPVER: " & ASAPVER
+ VbsLog " Client: " & GetClientVersion()
+ VbsLog " Last boot time: " & GetLastBootTime()
+ VbsLog " Reboot required: " & GetRebootStatus()
+ VbsLog " Manufacturer: " & GetHardwareInfo("Manufacturer")
+ VbsLog " Model: " & GetHardwareInfo("Model")
+ VbsLog " Location: " & GetLocation()
+ VbsLog " User: " & GetCurrentUser()
+ VbsLog "======================================================="
+End Sub
+
+'----- Client Check -----
+'Description: Returns the client version, if version is valid; x if invalid
+'Usage: ClientCheck()
+'-----------------------
+Function ClientCheck()
+ Dim strComputer, objWMIService, objItem, colItems
+ Dim systype, objOS
+ Dim clientVersion, i
+ Dim arrClients
+
+ clientVersion = "x"
+
+ If(IDO_32 = 1) Then arrClients = arrClients + "i.Do1.X;"
+ If(C_IDO_32 = 1) Then arrClients = arrClients + "C-i.Do.1.X 32 Bit;"
+ If(C_IDO_64 = 1) Then arrClients = arrClients + "C-i.Do.1.X 64 Bit;"
+ If(ACB_32_O = 1) Then arrClients = arrClients + "AC-B-32-O;"
+ If(AC1_32_O = 1) Then arrClients = arrClients + "AC1-32-O;"
+ If(AC2_32_O = 1) Then arrClients = arrClients + "AC2-32-O;"
+ If(AC2_64_O = 1) Then arrClients = arrClients + "AC2-64-O;"
+ If(AC3_Alpha = 1) Then arrClients = arrClients + "AC3-Alpha;"
+
+ If(AC2_32_N = 1) Then arrClients = arrClients + "AC2-32-N;"
+ If(AC2_64_N = 1) Then arrClients = arrClients + "AC2-64-N;"
+
+ If(ASAP_7 = 1) Then arrClients = arrClients + "ASAP7.X;"
+
+ If(AC4_64_O = 1) Then arrClients = arrClients + "AC4-64-O;"
+ If(AC4_64_N = 1) Then arrClients = arrClients + "AC4-64-N;"
+
+
+ arrClients = Split(arrClients, ";")
+
+ clientVersion = GetClientVersion()
+
+ For i = LBound(arrClients) To UBound(arrClients)-1
+ If arrClients(i) = clientVersion Then
+ ClientCheck = clientVersion
+ Exit Function
+ End If
+ Next
+ ErrorHandling 16010, ""
+ FinishScript()
+End Function
+
+'----- Change Service -----
+'Description: Change Service startmode or state
+'Usage: ChangeService ,
+'Output: ErrorCode
+'Example: ChangeService "Spooler", "Restart"
+' ChangeService "Spooler", "Disabled"
+'--------------------------------------
+Function ChangeService(ServiceName, StartStop)
+ Dim WantStarted, DesiredState, StartedStopped, ServiceDescr, Result
+ Dim objWMIService, listOfServices, objService, WaitFor
+ Result = 0
+ Select Case LCase(StartStop)
+ Case "start"
+ StartStop = "Start"
+ StartedStopped = "started"
+ WantStarted = True
+ DesiredState = "Running"
+ case "stop"
+ StartStop = "Stop"
+ StartedStopped = "stopped"
+ WantStarted = False
+ DesiredState = "Stopped"
+ Case "manual"
+ StartStop = "Manual"
+ StartedStopped = "stopped"
+ WantStarted = False
+ DesiredState = "Stopped"
+ Case "disabled"
+ StartStop = "Disabled"
+ StartedStopped = "stopped"
+ WantStarted = False
+ DesiredState = "Stopped"
+ Case "automatic", "auto"
+ StartStop = "Auto"
+ StartedStopped = "started"
+ WantStarted = True
+ DesiredState = "Running"
+ Case "restart"
+ ChangeService ServiceName, "stop"
+ ChangeService ServiceName, "start"
+ Exit function
+ Case Else
+ VbsLog " Result: Failed - (Wrond Syntax) in Function:ChangeService"
+ Exit Function
+ End Select
+
+ ' get the service object
+ Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
+ Set listOfServices = objWMIService.ExecQuery("select * from Win32_Service where Name = '" & ServiceName & "'")
+
+ If listOfServices.Count = 0 Then
+ VbsLog "Information | Service '" & ServiceName & "' not found."
+ Else
+ For Each objService In listOfServices
+ ServiceDescr = "The " & objService.Name & " service"
+
+ 'DesiteState = Servicetype & Start or Stop
+ If LCase(DesiredState) = LCase(objService.State) And (LCase(StartStop) = LCase("start") Or LCase(startStop) = LCase("stop")) Then
+ VbsLog "Information | Change Service: " & ServiceDescr & " is already " & objService.State & "."
+ Exit Function
+ End If
+
+ 'StartStop <> Manual & DesiredState = State & StartStop = Servicetyp
+ If LCase(startStop) <> "manual" And LCase(DesiredState)= LCase(objService.State) And LCase(StartStop) = LCase(objService.StartMode) Then
+ VbsLog "Information | Change Service: " & ServiceDescr & " is already " & objService.State & "."
+ Exit Function
+ End If
+
+ ' change service startmode
+ If StartStop = "Disabled" Then
+ Result = objService.changestartmode("disabled")
+ ElseIf StartStop = "Manual" Then
+ Result = objService.changestartmode("manual")
+ ElseIf StartStop = "Auto" Then
+ Result = objService.changestartmode("automatic")
+ End If
+
+ 'change service to manual if disabled and StartMode is start
+ If LCase(StartStop) = lcase("Start") And LCase(objService.StartMode) = lcase("disabled") Then
+ Result = objService.changestartmode("Manual")
+ If Result = 0 Then
+ VbsLog "Information | Change Service: " & ServiceDescr & " changed to manual"
+ Else
+ Errorhandling 1, "Change Service: " & objService.Name
+ End If
+ End If
+
+ ' start or stop service
+ If WantStarted = True Then
+ Result = objService.StartService()
+ Else
+ Result = objService.StopService()
+ End If
+
+ ' display success or failure message
+ Select Case Result
+ Case 0, 5, 10
+ WaitFor = 60000 '60 seconds
+ While WaitFor > 0
+ WScript.Sleep(500) : WaitFor = WaitFor - 500 '0.5 seconds
+ Set objService = objWMIService.Get("Win32_Service.Name='" & ServiceName & "'")
+
+ 'check objService.State / DesiredState (Running/Stopped)
+ If LCase(DesiredState) = LCase(objService.State) Then
+ 'check objService.StartMode / StartStop
+ 'if value StartStop not: start / stop
+ If Not LCase(StartStop) = "start" And Not LCase(StartStop) = "stop" And LCase(objService.startmode) = LCase(StartStop) Then
+ VbsLog "OK | Change Service: " & ServiceDescr & " " & StartedStopped
+ VbsLog "OK | Change Service: " & ServiceDescr & " changed to " & StartStop
+ Exit Function
+ Else
+ VbsLog "OK | Change Service: " & ServiceDescr & " " & StartedStopped
+ If LCase(StartStop) = LCase("Disabled") Then
+ VbsLog "OK | Change Service: " & ServiceDescr & " changed to " & StartStop
+ End If
+ Exit Function
+ End If
+ Else
+ If WaitFor =< 1000 Then VbsLog "ERROR : Failed - in Function:ChangeService"
+ End If
+ Wend
+ Case 2
+ Errorhandling 2, "Change Service: " & ServiceDescr & _
+ " can't be changed because the user did not have the necessary access"
+ Case 3
+ Errorhandling 3, "Change Service: " & ServiceDescr & _
+ " can't be stopped because dependant services are running."
+ Case Else
+ Errorhandling Result, "Change Service: " & ServiceDescr & _
+ " is in state " & objService.State & "."
+ End Select
+ Next
+ ChangeService = Result
+ End If
+End Function
+
+'----- Delete Service -----
+'Description: Delete Service
+'Usage: DeleteService
+'Output: n/a
+'Example: DeleteService "Spooler"
+'--------------------------------------
+Function DeleteService(ServiceName)
+ Dim objWMIService,colListOfServices,objService
+ Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
+ Set colListOfServices = objWMIService.ExecQuery("Select * from Win32_Service Where Name = '" & ServiceName & "'")
+
+ If colListOfServices.Count = 0 Then
+ VbsLog "Information | Delete Service (Service doesn't exist) [" & ServiceName & "]"
+ Else
+ For Each objService in colListOfServices
+ objService.StopService()
+ objService.Delete()
+ VbsLog "OK | Service deleted: [" & ServiceName & "]"
+ Next
+ End If
+End Function
+
+'----- Check File -----
+'Description: Returns if file exists
+'Usage: CheckFile
+'Output: True / False
+'Example: CheckFile "c:\temp\text.txt"
+'--------------------------
+Function CheckFile(File)
+ CheckFile = FSO.FileExists(File)
+End Function
+
+'----- Check Folder -----
+'Description: Returns if folder exists
+'Usage: CheckFolder
+'Output: True / False
+'Example: CheckFolder "c:\temp"
+'--------------------------
+Function CheckFolder(Folder)
+ CheckFolder = FSO.FolderExists(Folder)
+End Function
+
+'----- Check Is Laptop -----
+'Description: Check if client is a Laptop
+'Usage: CheckIsLaptop()
+'Output: True or False
+'Example: CheckIsLaptop()
+'-------------------------
+Function CheckIsLaptop()
+ Dim strComputer, objWMIService, colItems, objItem
+ strComputer = "."
+ On Error Resume Next
+ Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/cimv2" )
+ Set colItems = objWMIService.ExecQuery( "Select * from Win32_Battery", , 48 )
+ CheckIsLaptop = False
+ For Each objItem in colItems
+ CheckIsLaptop = True
+ Next
+ If Err Then Err.Clear
+ On Error Goto 0
+End Function
+
+'----- Check Process -----
+'Description: Checks if process(es) is/are running
+'Usage: CheckProc
+'Output: True / False
+'Example: CheckProc "ccmexec.exe,windword.exe"
+'--------------------------
+Function CheckProc(strProcess)
+ Dim process,v,i
+
+ CheckProc = False
+ v=Split(strProcess,",")
+ For i=0 To UBound(v)
+ For Each process In GetObject("winmgmts://.").InstancesOf("win32_process")
+ If UCase(Process.name) = UCase(Trim(v(i))) Then
+ CheckProc = True
+ Exit Function
+ End If
+ Next
+ Next
+End Function
+
+'----- Check if Product installed -----
+'Description: Checks if a Product is installed
+'Usage: CheckProduct
+'Output: TRUE if Product is installed
+'Example: CheckProduct "{B332732A-4958-41DD-B439-DDA2D32753C5}"
+'--------------------------------------
+Function CheckProduct(ProductCode)
+ Dim objInstaller
+
+ Set objInstaller = WScript.CreateObject("WindowsInstaller.Installer")
+ ret = objInstaller.ProductState(ProductCode)
+ If ret = 5 Then
+ VbsLog "Installed: " & objInstaller.ProductInfo(ProductCode, "ProductName") & " (" & objInstaller.ProductInfo(ProductCode, "Publisher") & ") V" & objInstaller.ProductInfo(ProductCode, "VersionString")
+ CheckProduct = True
+ Else
+ VbsLog "Product is NOT installed (" & ProductCode & ")"
+ CheckProduct = False
+ End If
+End Function
+
+'----- Runs commandline and logs into logfile -----
+'Description: Runs a commandline and logs its output into the logfile
+'Usage: CommandWithOutput ,
+'Output: Exitcode
+'Example: CommandWithOutput "cmd /c dir c:\","0"
+'--------------------------------------
+Function CommandWithOutput(Command,Abbruch)
+ Dim output,objWSH_Exec,i,v
+ Const WSHRunning = &H0
+
+ VbsLog "Execute CommandWithOutput Function: '" & Command & "' '" & Abbruch & "'"
+ VbsLog "==========> Start CMD Command Output <=========="
+
+ WshShell.CurrentDirectory = InstallDir
+ Set objWSH_Exec = WshShell.Exec(command)
+
+ With objWSH_Exec
+ Do While .Status = WSHRunning
+ Do Until objWSH_Exec.StdOut.AtEndOfStream
+ output = objWSH_Exec.StdOut.ReadLine
+ VbsLog Trim(output)
+ Loop
+ Loop
+
+ Ret = objWSH_Exec.ExitCode
+ CommandWithOutput = Ret
+
+ VbsLog "==========> End CMD Command Output <=========="
+
+ If Abbruch = "" Then
+ VbsLog "+ RESULT CommandWithOutput: OK | Accepting all ExitCodes [" & Ret & "]"
+ Else
+ v=Split(Abbruch,",")
+ For i = LBound(v) To UBound(v)
+ If StrComp(Ret,v(i)) = 0 Then
+ VbsLog "+ RESULT CommandWithOutput: OK | Accepted ExitCode (" & v(i) & ", " & ErrorText(Ret) & " )"
+ Exit Function
+ End If
+ Next
+ VbsLog "+ RESULT CommandWithOutput: ERROR | ExitCode (" & Ret & ", " & ErrorText(Ret) & " )"
+ ErrorHandling Ret,ErrorText(Ret)
+ FinishScript()
+ End If
+ End With
+End Function
+
+'----- Copy File -----
+'Description: Copies File(s)
+'Usage: CopyFile ,
+'Output: True / False
+'Example: CopyFile "text.txt", "c:\temp\"
+' CopyFile "text.txt", "c:\temp\newtext.txt"
+'--------------------------
+Function CopyFile(Source,ByVal Dest)
+ Dim FSO
+ Set FSO = CreateObject("Scripting.FileSystemObject")
+ On Error Resume Next
+ FSO.CopyFile Source, Dest, True
+
+ If Err.Number = 70 Then
+ If Right(Dest, 1) = "\" And InStr(Source, "*") = 0 Then
+ If InStr(Source, "\") <> 0 Then
+ Dest = Dest & Right(Source,Len(Source) - InStrRev(Source, "\"))
+ Else
+ Dest = Dest & Source
+ End If
+ End If
+ Err.Clear
+ Ret = FSO.GetFile(Dest).Attributes
+ FSO.GetFile(Dest).Attributes = 0
+ FSO.CopyFile Source, Dest, True
+ FSO.GetFile(Dest).Attributes = Ret
+ End If
+
+ If Err.Number = 0 Then
+ CopyFile = True
+ VbsLog "OK | File copy: [" & source & "] --> [" & dest & "]"
+ Else
+ CopyFile = False
+ ErrorHandling Err.Number, "File copy: (" & Err.Description & "): [" & source & "] --> [" & dest & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Copy Folder -----
+'Description: Copy Folder(s)
+'Usage: CopyFolder ,
+'Output: True / False
+'Example: CopyFolder "redist", "c:\temp\"
+'-----------------------
+Function CopyFolder(Source,Dest)
+ Dim FSO
+ Set FSO = CreateObject("Scripting.FileSystemObject")
+ On Error Resume Next
+ FSO.CopyFolder Source,Dest,True
+ If Err.Number = 0 Then
+ CopyFolder = True
+ VbsLog "OK | Folder copy [" & source & "] --> [" & dest & "]"
+ Else
+ CopyFolder = False
+ ErrorHandling Err.Number, "Folder copy (" & Err.Description & "): [" & source & "] --> [" & dest & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Copy Folder XCopy -----
+'Description: Copy Folder(s) via XCopy
+'Usage: CopyFolderX ,
+'Output: Returncode of xcopy.exe
+'Example: CopyFolderX "C:\Programme\", "D:\Programme"
+'-----------------------
+Function CopyFolderX(fs, dest)
+ CreateFolder dest
+ CopyFolderX = run ("XCopy","xcopy.exe """ & fs & """ """ & dest & """ /E /R /Y /Q", "")
+End Function
+
+'----- Create Folder -----
+'Description: Create Folder
+'Usage: CreateFolder
+'Output: True / False
+'Example: CreateFolder "c:\temp\newfolder"
+'-------------------------
+Function CreateFolder(ByVal folder)
+ If Right(folder, 1) <> "\" Then folder = folder + "\"
+ Dim fso, pointer, newFolder
+ Set fso = CreateObject("Scripting.FileSystemObject")
+ pointer=0
+ On Error Resume Next
+ If FSO.FolderExists(Folder) = True Then
+ VbsLog "Information | Function CreateFolder. Folder [" & folder & "] exist."
+ CreateFolder = True
+ On Error Goto 0
+ Exit Function
+ End If
+ Do While pointer < Len(Folder)
+ pointer = InStr(pointer + 1,folder, "\")
+ newFolder = Left(folder, pointer)
+ If Not fso.FolderExists(newFolder) Then FSO.CreateFolder(newFolder)
+ Loop
+ If Err.Number = 0 Then
+ VbsLog "OK | Folder [" & folder & "] created."
+ CreateFolder = True
+ Else
+ ErrorHandling Err.Number, "Folder not created: " & Err.Description
+ CreateFolder = False
+ End If
+ On Error Goto 0
+End Function
+
+'----- Create ShortCut -----
+'Description: Create a shortcut
+'Usage: CreateShortCut , , , ,
+'Output: True / False
+'Example: CreateShortcut "C:\...\Desktop", "ShortCutName", WinDir & "\System32\cmd.exe", "C:\Test.ico, 5", "-c"
+'---------------------------
+Function CreateShortcut(lnkDestPath, ByVal lnkName, lnkTargetPath, IconLocation, lnkArguments) 'Bsp: CreateShortcut AllUsersProfile & "\Desktop", "ShortCutName", WinDir & "\System32\cmd.exe", "C:\Test.ico", "-c"
+ Dim oShellLink, lnkWorkingDirectory
+ Dim f, i, strPath
+ VbsLog "Execute CreateShortcut Function: '" & lnkDestPath & "' '" & lnkName & "' '" & lnkTargetPath & "' '" & IconLocation & "' '" & lnkArguments & "'"
+
+ On Error Resume Next
+ If Not Right(lnkTargetPath, 1) = "\" Then
+ f = Split(lnkTargetPath, "\")
+ If UBound(f) >= 1 Then
+ For i = 0 To UBound(f)-1
+ lnkWorkingDirectory = lnkWorkingDirectory & f(i) & "\"
+ Next
+ End If
+ Else
+ lnkWorkingDirectory = lnkTargetPath
+ End If
+
+ If Not Right(LCase(lnkname),4) = ".lnk" And Not Right(LCase(lnkName),4) = ".url" Then
+ lnkName = lnkName & ".lnk"
+ End If
+
+ If InStr(Right(LCase(IconLocation), 5),", ") = False Then IconLocation = IconLocation & ", 0"
+
+ 'Set WshShell = WScript.CreateObject("WScript.Shell")
+ Set oShellLink = WshShell.CreateShortcut(lnkDestPath & "\" & lnkName)
+ oShellLink.TargetPath = lnkTargetPath
+ 'oShellLink.WindowStyle = 1
+ If Not Right(LCase(lnkName),4) = ".url" Then
+ oShellLink.WorkingDirectory = lnkWorkingDirectory
+ oShellLink.IconLocation = IconLocation
+ oShellLink.Description = "Shortcut"
+ oShellLink.Arguments = lnkArguments
+ End If
+
+ oShellLink.Save
+
+ If Err.Number <> 0 Then
+ ErrorHandling Err.Number, "+ RESULT CreateShortcut: ERROR " & Err.Number & ", " & Err.Description
+ CreateShortcut = False
+ Else
+ VbsLog "+ RESULT CreateShortcut: OK"
+ CreateShortcut = True
+ End If
+
+ On Error Goto 0
+End Function
+
+'----- Create Task -----
+'Description: Creates Task
+'Usage: CreateTask , ,
+'Output: True / False
+'Example: CreateTask "Taskname","c:\temp\name.exe","EINMAL"
+'Parameter: : MINUTE, STNDLICH, TGLICH, MONATLICH, EINMAL, BEIMSTART, BEIANMELDUNG, BEILEERLAUF
+'-----------------------
+Function CreateTask (name, file, plan)
+ On Error Resume Next
+ Dim strArgument
+
+ If Left(GetOSVersion(), 1) > 5 Then strArgument = " /F"
+
+ Ret = WSHShell.Run ("schtasks.exe /create /tn """ & name & """ /tr """ & file & """ /sc " & plan & " /ru SYSTEM" & strArgument, 0, True)
+ If Ret <> 0 Then
+ CreateTask = False
+ ErrorHandling Ret, "ERROR (" & Ret & ") | Task not created: [" & name & "] [" & file & "] [" & plan & "]"
+ Else
+ CreateTask = True
+ VbsLog "OK | Task created: [" & name & "] [" & file & "] [" & plan & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Create Uninstall -----
+'Description: Creates Uninstall
+'Usage: CreateUninstall("")
+'Example: CreateUninstall "MySoftware"
+'----------------------------
+Function CreateUninstall(Name)
+ Dim v, strName, strPublisher, strVersion
+ VbsLog "---------- Execute CreateUninstall Function: '" & Name & "'"
+ v = Split(name, "_")
+ Select Case UBound(v)
+ Case 1,2 : strPublisher = v(0) : strName = v(1) : strVersion = pVersion
+ Case Else
+ v = Empty
+ v = Split(pName, "_")
+ If UBound(v) >= 1 Then
+ strPublisher = v(0) : strName = v(1) : strVersion = pVersion : Name = pName
+ Else
+ strPublisher = pName : strName = pName : strVersion = pVersion : Name = pName
+ End If
+ End Select
+
+ 'CreateFolder WinDir & "\SW-Source\" & Name
+ 'CopyFile "_Uninstall.vbs", WinDir & "\SW-Source\" & Name & "\"
+ 'CopyFile "_Functions.vbs", WinDir & "\SW-Source\" & Name & "\"
+
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\Displayname" ,strName,32
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\DisplayVersion" ,strVersion,32
+ WriteReg "DWORD","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\NoModify" ,1,32
+ WriteReg "DWORD","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\NoRepair" ,1,32
+ WriteReg "DWORD","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\NoRemove" ,1,32
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\Publisher" ,strPublisher,32
+ WriteReg "SZ" ,"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name & "\UninstallString","wscript.exe """ & WINDIR & "\sw-source\" & Name & "\_Uninstall.vbs"" //B",32
+ VbsLog "---------- RESULT CreateUninstall: OK"
+End Function
+
+'----- Delete File -----
+'Description: Deletes File(s)
+'Usage: DeleteFile
+'Output: True / False
+'Example: DeleteFile "c:\temp\text.txt"
+'-----------------------
+Function DeleteFile(File)
+ On Error Resume Next
+ FSO.DeleteFile File, True
+ If Err.Number = 0 Then
+ DeleteFile = True
+ VbsLog "OK | File delete: [" & File & "]"
+ ElseIf Err.Number = 53 Then
+ DeleteFile = False
+ VbsLog "Information | File delete (" & Err.Description & "): [" & File & "]"
+ Else
+ DeleteFile = False
+ ErrorHandling Err.Number, "File delete: (" & Err.Description & ") [" & File & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Delete Folder -----
+'Description: Deletes Folder
+'Usage: DeleteFolder
+'Output: True / False
+'Example: DeleteFolder "c:\temp\test"
+'-----------------------
+Function DeleteFolder(Folder)
+ On Error Resume Next
+ If FSO.FolderExists(Folder) Then
+ FSO.DeleteFolder Folder, True
+
+ If Err.Number = 70 Then
+ Err.Clear
+ FSO.GetFolder(Folder).Attributes = 0
+ FSO.DeleteFolder Folder, True
+ End If
+ If Err.Number = 0 Then
+ DeleteFolder = True
+ VbsLog "OK | Folder delete: [" & Folder & "]"
+ Else
+ DeleteFolder = False
+ ErrorHandling Err.Number, "Folder delete: (" & Err.Description & "): [" & Folder & "]"
+ End If
+ Else
+ DeleteFolder = False
+ VbsLog "Information | Folder delete (Folder don't exist): [" & Folder & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Delete Folder 2 -----
+'Description: Deletes Folder
+'Usage: DeleteFolder2 ,
+'Output: True / False
+'Example: DeleteFolder2 "C:\Temp\Testordner", "1,70"
+'---------------------------
+Function DeleteFolder2(Folder, AcceptedErrNr)
+ Dim ErrNr, i, TempErr, TempErrDesc
+ DeleteFolder2 = False
+ If FSO.FolderExists(Folder) Then
+ On Error Resume Next
+ FSO.DeleteFolder Folder, True
+ TempErr = Err.Number : TempErrDesc = Err.Description
+ On Error Goto 0
+
+ If TempErr = 0 Then
+ DeleteFolder2 = True
+ VbsLog "OK | Folder delete: [" & Folder & "]"
+ Else
+ ErrNr = Split(AcceptedErrNr, ",")
+ If UBound(ErrNr) >= 0 Then
+ For i = LBound(ErrNr) To UBound(ErrNr)
+ If CInt(ErrNr(i)) = CInt(TempErr) Then
+ VbsLog "Information | Folder delete accepted ExitCode (" & TempErr & "): (" & TempErrDesc & "): [" & Folder & "]"
+ Exit Function
+ End If
+ Next
+ End If
+ End If
+ ErrorHandling TempErr, "Folder delete: (" & TempErrDesc & "): [" & Folder & "]"
+ Else
+ VbsLog "Information | Folder delete (Folder don't exist): [" & Folder & "]"
+ End If
+End Function
+
+'----- Delete Registry -----
+'Description: Deletes Registry values, keys
+'Usage: DeleteReg , ,
+'Output: ErrorCode
+'Example: DeleteReg "KEY", "HKLM\Software\Testvalue", 64
+'Parameters: : KEY, VALUE
+'---------------------------
+Function DeleteReg (strRegType, key, hive)
+ Dim strRootKey, strKey, strValueName, objCtx, objLocator, objReg, intReturnCode, rootKey, keys, i, OPName
+
+ keys = Split(key,"\")
+ strRootKey = keys(0)
+ For i = 1 To UBound(keys)
+ strKey = strKey + keys(i) + "\"
+ Next
+ strValueName = keys(UBound(keys))
+
+ Select Case UCase(strRootKey)
+ Case "HKCR", "HKEY_CLASSES_ROOT"
+ rootKey = &h80000000
+ Case "HKCU", "HKEY_CURRENT_USER"
+ rootKey = &h80000001
+ Case "HKLM", "HKEY_LOCAL_MACHINE"
+ rootKey = &h80000002
+ Case "HKU", "HKEY_USERS"
+ rootKey = &h80000003
+ Case "HKCC", "HKEY_CURRENT_CONFIG"
+ rootKey = &h80000005
+ End Select
+
+ Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+ objCtx.Add "__ProviderArchitecture", hive
+ Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
+ Set objReg = objLocator.ConnectServer("", "root\default", "", "", , , , objCtx).Get("StdRegProv")
+
+ If UCase(strRegType) = "KEY" Then
+ OPName = "Delete Key"
+ Dim iRC,SubKeys,sKey
+ iRC = objReg.EnumKey (rootKey, strKey, SubKeys)
+
+ If iRC = 0 Then
+ If Not IsNull(SubKeys) Then
+ For Each sKey In SubKeys
+ DeleteReg "Key",strRootKey & "\" & strKey & sKey, hive
+ Next
+ End If
+ intReturnCode = objReg.DeleteKey (rootKey, strKey)
+ Else
+ intReturnCode = objReg.DeleteKey (rootKey, strKey)
+ End If
+ End If
+
+ If UCase(strRegType) = "VALUE" Then
+ OPName = "Delete Value"
+ strKey = Mid(key, Len(keys(0)) + 2, Len(key) - Len(keys(UBound(keys))) - Len(keys(0)) - 2)
+ strValueName = keys(UBound(keys))
+ intReturnCode = objReg.DeleteValue(rootKey,strKey,strValueName,"")
+ End If
+ DeleteReg = intReturnCode
+ If intReturnCode = 0 Then
+ VbsLog "OK | " & OPName & " [(" & hive & ") " & key & "]"
+ ElseIf intReturnCode = 2 Then
+ VbsLog "Information (" & intReturnCode & ") | " & OPName & ": Value not found [(" & hive & ") " & key & "]"
+ Else
+ ErrorHandling intReturnCode, OPName & ": [(" & hive & ") " & key & "]"
+ End If
+End Function
+
+'----- Delete Task -----
+'Description: Deletes a task
+'Usage: DeleteTask
+'Output: True / False
+'Example: DeleteTask "Testtask"
+'---------------------------
+Function DeleteTask(name)
+ On Error Resume Next
+ If Left(GetOSVersion(), 1) < 6 Then
+ ReDim arrTaskName(-1)
+ Dim oExec, x, i, output
+
+ Set oExec = WshShell.Exec("cmd /C schtasks.exe /Query /nh /fo csv")
+
+ Ret = 1
+ Do Until oExec.StdOut.AtEndOfStream
+ output = oExec.StdOut.ReadLine
+ If Len(output) > 1 And InStr(1, output, ",",1) <> 0 then
+ x = Split(output, ",")
+ ReDim preserve arrTaskName(Ubound(arrTaskName) + 1)
+ arrTaskName(UBound(arrTaskName)) = x(0)
+ End If
+ Loop
+
+ For i = LBound(Arrtaskname) To UBound(arrTaskName)
+ If LCase(Replace(arrTaskName(i),"""", "")) = LCase(name) Then
+ Ret = 0
+ End If
+ Next
+ Else
+ Ret = WSHShell.Run ("schtasks.exe /QUERY /TN """ & name & """", 0, True)
+ End If
+ VbsLog "TaskCommand = schtasks.exe /QUERY /TN """ & name & """ = "&Ret
+ If Ret <> 0 Then
+ VbsLog "Information | Delete Task (Task don't exist) [" & name & "]"
+ DeleteTask = False : Err.Clear
+ Exit Function
+ End If
+ Ret = WSHShell.Run ("schtasks.exe /Delete /TN """ & name & """ /f", 0, True)
+ If ret <> 0 Then
+ DeleteTask = False
+ ErrorHandling ret, "Task delete: [" & name & "]"
+ Else
+ DeleteTask = True
+ VbsLog "OK | Task delete: [" & name & "]"
+ End If
+ On Error Goto 0
+End Function
+
+'----- Delete Uninstall -----
+'Description: Deletes Uninstall in 32Bit-hive
+'Usage: DeleteUninstall("")
+'Example: DeleteUninstall "MySoftware"
+'----------------------------
+Function DeleteUninstall(Name)
+ If Name = "" Then Name = pName
+ DeleteReg "KEY","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name,32
+End Function
+
+
+'----- Delete Uninstall 64-----
+'Description: Deletes Uninstall in 64Bit-hive
+'Usage: DeleteUninstall64("")
+'Example: DeleteUninstall64 "MySoftware"
+'----------------------------
+Function DeleteUninstall64(Name)
+ If Name = "" Then Name = pName
+ DeleteReg "KEY","HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" & Name,64
+End Function
+
+
+'----- ErrorHandling -----
+' Function: ErrorHandling
+' Input: errorCode
+' Description: Collects error codes
+'**********************************************************************
+Sub ErrorHandling(errorCode,errorDescription)
+ If InStr(errorCode, "0") = 1 Then Exit Sub
+ If errorDescription = Empty Then ErrorDescription = ErrorText(errorCode)
+ VbsLog "ERROR (" & errorCode & ") | " & ErrorDescription
+ ReDim preserve errorList0(Ubound(errorList0) + 1)
+ errorList0(UBound(errorList0)) = errorCode
+End Sub
+
+
+'----- Error Text -----
+'Description: Returns Errortext
+'Usage: ErrorText
+'Example: ErrorName = ErrorText (3010)
+'---------------------------
+Function ErrorText(number)
+ If CheckFile("ErrorHandling.xml") Then
+ ErrorText = XMLErrordescription(number)
+ If ErrorText = "" Then ErrorText = ""
+ Else
+ Select Case number
+ Case "0" ErrorText="OK"
+ Case "1" ErrorText="Unspecific error occured"
+ Case "999" ErrorText="User info screen canceled by user."
+ Case "1601" ErrorText="The Windows Installer service could not be accessed."
+ Case "1603" ErrorText="Fatal error during installation."
+ Case "1605" ErrorText="This action is only valid for products that are currently installed."
+ Case "1618" ErrorText="Another installation is already in progress."
+ Case "1619" ErrorText="This installation package could not be opened."
+ Case "1624" ErrorText="Error applying transforms."
+ Case "1641" ErrorText="The installer has started a reboot."
+ Case "1642" ErrorText="The installer cannot install the upgrade patch because the program being upgraded may be missing, or the upgrade patch updates a different version of the program."
+ Case "3010" ErrorText="A restart is required to complete the install."
+ Case "5100" ErrorText="Restart required before installation can start."
+ Case "16005" ErrorText="Not by software-deployment installed and by Client Management I/FP-94 predetermined Version."
+ Case "16010" ErrorText="Audi Client not supported."
+ Case Else ErrorText=""
+ End Select
+ End If
+End Function
+
+'----- Finish Script -----
+'Description: Script-Finish-Wrapper
+'Usage: FinishScript()
+'Example: FinishScript()
+'---------------------------
+Function FinishScript()
+ Dim errorItem, failed, v, strFinish
+ failed = 0
+ VbsLog "======================================================="
+ For Each errorItem In errorList0
+ VbsLog "= ERROR: " & errorItem
+ If failed = 0 Then
+ failed = errorItem
+ Else
+ failed = 1
+ End If
+ Next
+
+ strFinish = "Installation"
+ If InStr(UCase(WScript.ScriptName),"UNINSTALL") > 0 Then
+ strFinish = "Deinstallation"
+ End If
+
+ If failed <> 0 Or Err <> 0 Then
+ VbsLog "= " & pName & " " & pVersion & " " & strFinish & " FAILED"
+ VbsLog "======================================================="
+ WScript.Quit(failed)
+ Else
+ VbsLog "= " & pName & " " & pVersion & " " & strFinish & " SUCCEEDED"
+ VbsLog "======================================================="
+ WScript.Quit(0)
+ End If
+End Function
+
+'----- FreeSpace Script -----
+'Description: Free Space on Drive
+'Usage: FreeSpace
+'Example: FreeSpace "c:"
+'Returns: Free space in MB
+'---------------------------
+Function FreeSpace(drv)
+ Dim drive,fso
+ Set fso = CreateObject("Scripting.FileSystemObject")
+ Set drive = fso.GetDrive(drv)
+ FreeSpace = Round(drive.FreeSpace/1024/1024)
+End Function
+
+'----- Get Client Version -----
+'Description: Returns the Audi-Client-Version
+'Usage: GetClientVersion()
+'Output: ClientVersion
+'Example: ClientVersion = GetClientVersion()
+'------------------------------
+Function GetClientVersion()
+ Dim clientVersion : clientVersion = "unknown"
+
+ If GetOSBit() = 64 And Left(GetOSVersion(), 3) = "6.3" Then
+ clientVersion = "AC3-Alpha"
+ GetClientVersion = clientVersion
+ Exit Function
+ End If
+
+ If ACVER = Empty Then
+ GetClientVersion = "unknown"
+ Exit Function
+ End If
+
+ Select Case Mid(ACVER, 3, 2)
+ Case 99 : clientVersion = "ASAP6.X"
+ Case 98 : clientVersion = "ASAP7.X"
+ Case 97 : clientVersion = "i.Do1.X"
+ Case 96 : clientVersion = "C-i.Do.1.X 32 Bit"
+ Case 95 : clientVersion = "C-i.Do.1.X 64 Bit"
+ Case 94 : clientVersion = "AC1-32-O"
+ Case 93 : clientVersion = "MED-V auf Basis AC-B-32-N"
+
+ Case 11 : clientVersion = "AC4-64-N"
+ Case 10 : clientVersion = "AC4-64-O"
+
+ Case 06 : clientVersion = "AC-B-32-N"
+ Case 05 : clientVersion = "AC-B-32-O"
+ Case 04 : clientVersion = "AC2-64-N"
+ Case 03 : clientVersion = "AC2-64-O"
+ Case 02 : clientVersion = "AC2-32-N"
+ Case 01 : clientVersion = "AC2-32-O"
+ case else : clientVersion = "unknown"
+ End Select
+
+ GetClientVersion = clientVersion
+End Function
+
+'----- Get Current User -----
+'Description: Returns if the currently logged on user
+'Usage: GetCurrentUser()
+'Output: Domain\User
+'Example: CurrentUser = GetCurrentUser()
+'----------------------------
+Function GetCurrentUser()
+ Dim strComputer, objWMIService, colItems, objItem
+ Dim tempLastUseTime, tempSID
+ On Error Resume Next
+ strComputer = "."
+ GetCurrentUser = ""
+
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ GetCurrentUser = objItem.UserName
+ Next
+ On Error Goto 0
+End Function
+
+'----- Get Current User SID -----
+'Description: Returns the SID of the currently logged on user
+'Usage: GetCurrentUserSID()
+'Output: SID
+'Example: CurrentUserSID = GetCurrentUserSID()
+'--------------------------------
+Function GetCurrentUserSID()
+ Dim strComputer, objWMIService, colItems, objItem
+ Dim tempLastUseTime, tempSID
+ On Error Resume Next
+ strComputer = "."
+ GetCurrentUserSID = ""
+ tempSID = ""
+
+ ' Part 1 (1st Try)
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT * FROM Win32_UserProfile WHERE Loaded = 1 And Special = 0",,48)
+ For Each objItem In colItems
+ If Left(objItem.SID, 8) = "S-1-5-21" And Not Left(Right(objItem.SID, 4), 1) = "-" Then
+ If objItem.LastUseTime > tempLastUseTime Then
+ tempLastUseTime = objItem.LastUseTime
+ GetCurrentUserSID = objItem.SID
+ tempSID = objItem.SID
+ End If
+ End If
+ Next
+ Err.Clear
+
+ If Len(tempSID) > 0 Then
+ GetCurrentUserSID = tempSID
+ On Error Goto 0
+ Exit Function
+ End If
+
+ ' Part 2 (2nd Try)
+ Dim user, objAccount
+
+ Set colItems = objWMIService.ExecQuery("Select UserName from Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ user = Split(objItem.UserName, "\")
+ Next
+
+ If UBound(user) > 0 Then
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT * FROM Win32_UserAccount WHERE Name='" + user(1) + " And Domain='" + user(0) + "'",,48)
+
+ Set objAccount = objWMIService.Get("Win32_UserAccount.Name='" & user(1) & _
+ "',Domain='" & User(0) & "'")
+ tempSID = objAccount.SID
+
+ If Len(tempSID) > 0 Then
+ GetCurrentUserSID = tempSID
+ On Error Goto 0
+ Exit Function
+ End If
+ End If
+
+ ' Part 3 (3rd Try)
+ Dim oReg : Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
+ Dim subKey, arrSubKeys
+ oReg.EnumKey &H80000003, "", arrSubKeys
+
+ For Each subKey In arrSubKeys
+ If Left(subKey, 8) = "S-1-5-21" And InStr(subKey, "Classes") = 0 And Not Left(Right(subKey, 4), 1) = "-" Then
+ tempSID = subKey
+ End If
+ Next
+
+ GetCurrentUserSID = tempSID
+ On Error Goto 0
+End Function
+
+'----- Get File Version -----
+'Description: Determines the version of a file
+'Usage: GetFileVersion()
+'Output: FileVersion
+'Example: FileVersion = GetFileVersion "file.exe"
+'----------------------------
+Function GetFileVersion(file)
+ If Not FSO.FileExists(file) Then
+ VbsLog "Information | Version of File: " + file + " : NOT FOUND"
+ GetFileVersion = "0"
+ Exit Function
+ End If
+ GetFileVersion = FSO.GetFileVersion(file)
+ VbsLog "Version of File: " + file + " : " + GetFileVersion
+End Function
+
+'----- Get Hardware Info -----
+'Description: Reads Hardware Info
+'Usage: GetHardwareInfo(Type)
+'Output: Desired Value
+'Example: Manufacturer = GetHardwareInfo "Manufacturer"
+'----------------------------
+Function GetHardwareInfo(text)
+ Dim objWMIService,colItems,objItem
+ Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
+ For Each objItem In colItems
+ If UCase(text) = "MANUFACTURER" Then GetHardwareInfo = objItem.Manufacturer
+ If UCase(text) = "MODEL" Then GetHardwareInfo = objItem.Model
+ Next
+End Function
+
+'----- Get Language -----
+'Description: Determines the client language
+'Usage: GetLanguage()
+'Output: DE/HU/EN/FR/IT/ES
+'Example: Language = GetLanguage()
+'------------------------
+Function GetLanguage()
+ Dim langID
+ langId = GetRegKeyValue("REG_SZ", "HKLM\SYSTEM\CurrentControlSet\Control\Nls\Language\Default", GetOSBit())
+ Select Case UCase(Right(langId,2))
+ Case "0E"
+ GetLanguage = "HU"
+ Case "07"
+ GetLanguage = "DE"
+ Case "09"
+ GetLanguage = "EN"
+ Case "0C"
+ GetLanguage = "FR"
+ Case "10"
+ GetLanguage = "IT"
+ Case "0A"
+ GetLanguage = "ES"
+ Case Else
+ VbsLog "Error | Function: GetLanguage [Language unknown]"
+ GetLanguage = "unknown"
+ End Select
+End Function
+
+'----- Get Last Boot Time -----
+'Description: Returns boot date and time
+'Usage: GetLastBootTime()
+'Output: Boot date and time
+'Example: GetLastBootTime()
+'------------------------
+Function GetLastBootTime()
+ Dim objOperatingSystem, strComputer
+ Dim objSWbemDateTime, objWMIService, colOperatingSystems
+
+ Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime")
+
+ strComputer = "."
+
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
+ Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
+
+ For Each objOperatingSystem in colOperatingSystems
+ objSWbemDateTime.Value = objOperatingSystem.LastBootUpTime
+ GetLastBootTime = objSWbemDateTime.GetVarDate(True)
+ Next
+
+ Dim HoursSince,DaysSince,strOut
+ HoursSince = DateDiff("h",GetLastBootTime,Now())
+ If HoursSince>24 Then
+ DaysSince=Int(HoursSince/24)
+ strOut = DaysSince & "d " & HoursSince Mod 24 & "h"
+ Else
+ strOut = HoursSince & "h"
+ End If
+
+ GetLastBootTime = GetLastBootTime & " (" & strOut & ")"
+End Function
+
+'----- Get Location -----
+'Description: Determines the client location
+'Usage: GetLocation()
+'Output: IN/NE/GY/BX/SJ
+'Example: Location = GetLocation()
+'------------------------
+Function GetLocation()
+ Dim strComputername,oTSEnv,strSiteCode,oSMSClient
+
+ GetLocation = "unknown" 'default
+ strSiteCode = ""
+
+' Detecting Location
+ On Error Resume Next
+ Set oTSEnv = CreateObject("Microsoft.SMS.TSEnvironment")
+
+ If Err.Number = 0 Then
+' Determine SCCM site and computer name by OSD variables
+ strComputername = Ucase(oTSEnv("OSDComputerName"))
+ strSiteCode = Ucase(oTSEnv("_SMSTSSiteCode"))
+ Else
+ Err.Clear
+ Set oSMSClient = CreateObject("Microsoft.SMS.Client")
+ If Err.Number = 0 Then
+' Determine SCCM site by clients assigned site
+ strComputername = Computername
+ strSiteCode = UCase(oSMSClient.GetAssignedSite)
+ End If
+ Set oSMSClient = Nothing
+ End If
+ Set oTSEnv = Nothing
+ Err.Clear
+
+ If strSiteCode = Empty Then
+ Set oSMSClient = CreateObject("Microsoft.SMS.Client")
+ If Err.Number = 0 Then
+' Determine SCCM site by clients assigned site
+ strSiteCode = UCase(oSMSClient.GetAssignedSite)
+ Set oSMSClient = Nothing
+ End If
+ End If
+
+ On Error Goto 0
+
+' Determine SCCM site code
+ Select Case UCase(strSiteCode)
+ Case "IN0","IN1","INT","PI0","PI1","IA0","IA1"
+ GetLocation = "IN"
+ Case "NE0","NE1","NET","PN0","PN1"
+ GetLocation = "NE"
+ Case "GY0","GY1","PG0","PG1"
+ GetLocation = "GY"
+ Case "BX0","BX1","PB0","PB1"
+ GetLocation = "BX"
+ Case "PS0","SJ1","PJ1"
+ GetLocation = "SJ"
+ Case Else
+' Determine Location by ACVER
+ If ACVER <> False Then
+ Select Case Mid(ACVer,9,1)
+ Case 1 : GetLocation = "GY" : Exit Function
+ Case 2 : GetLocation = "BX" : Exit Function
+ Case 3 : GetLocation = "SJ" : Exit Function
+ End Select
+ Else
+ 'ACVER not found.
+ End If
+
+' Determine Location by Computername
+ Select Case UCase(Mid(strComputerName,5,2))
+ Case "IN"
+ GetLocation = "IN"
+ Case "NE"
+ GetLocation = "NE"
+ Case "BX"
+ GetLocation = "BX"
+ Case "GY"
+ GetLocation = "GY"
+ Case "SJ"
+ GetLocation = "SJ"
+ Case Else
+' Could not determine location. Location = unknown
+ End Select
+ End Select
+End Function
+
+'----- Get OS-Bit -----
+'Description: Returns the bitsystem
+'Usage: GetOSBit()
+'Output: 32 / 64
+'Example: OSBit = GetOSBit()
+'--------------------
+Function GetOSBit()
+ Dim strComputer, objWMIService, objItem, colItems
+
+ strComputer = "."
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT SystemType FROM Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ If (objItem.SystemType = "x64-based PC") Then
+ GetOSBit = 64
+ Else
+ GetOSBit = 32
+ End If
+ Next
+End Function
+
+'----- Get OS-Version -----
+'Description: Returns the Windows-OS-Version
+'Usage: GetOSVersion()
+'Output: OS Version
+'Example: OSVersion = GetOSVersion()
+'------------------------
+Function GetOSVersion()
+ Dim strComputer, objWMIService, objItem, colItems
+
+ strComputer = "."
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT Version FROM Win32_OperatingSystem",,48)
+ For Each objItem In colItems
+ GetOSVersion = objItem.Version
+ Next
+End Function
+
+'----- Check for Pending Reboots -----
+'Description: Returns the status of pending reboots
+'Usage: GetRebootStatus()
+'Output: Reboot source / False
+'Example: GetRebootStatus()
+'------------------------
+Function GetRebootStatus()
+ Dim sRebootNeeded, localdummy, localPFROarr, localErg, iHive
+ Dim objWMIService, colItems, objItem
+ Dim objWUSysInfo, objRegint, objAgentInfo
+ Dim oCtx, oLocator
+ Const HKEY_LOCAL_MACHINE = &H80000002
+ sRebootNeeded = False
+
+ Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery( _
+ "SELECT SystemType FROM Win32_ComputerSystem",,48)
+ For Each objItem In colItems
+ If (objItem.SystemType = "x64-based PC") Then
+ iHive = 64
+ Else
+ iHive = 32
+ End If
+ Next
+
+ 'VbsLog "Information | Checking Windows Update..."
+ Set objWUSysInfo = CreateObject("Microsoft.Update.SystemInfo")
+ If objWUSysInfo.RebootRequired Then
+ sRebootNeeded = "Windows Update"
+ End If
+ Set objWUSysInfo = Nothing
+
+ Set oCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+ oCtx.Add "__ProviderArchitecture", iHive
+ Set oLocator = CreateObject("Wbemscripting.SWbemLocator")
+
+ 'VbsLog "Information | Checking Component Based Servicing (CBS)..."
+ Set objRegint = oLocator.ConnectServer("", "root\default", "", "", , , , oCtx).Get("StdRegProv")
+ localErg = objRegint.EnumKey(HKEY_LOCAL_MACHINE,"Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending", localdummy)
+ If (localErg = 0) And (Err.Number = 0) Then
+ If sRebootNeeded <> False Then
+ sRebootNeeded = sRebootNeeded & " | Component Based Servicing"
+ Else
+ sRebootNeeded = "Component Based Servicing"
+ End If
+ End If
+ Set objRegInt = Nothing
+
+ 'VbsLog "Information | Checking Pending File Rename Operations..."
+ Set objRegint = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
+ LocalErg = objRegInt.GetMultiStringValue(HKEY_LOCAL_MACHINE,"SYSTEM\CurrentControlSet\Control\Session Manager","PendingFileRenameOperations", localPFROarr)
+ If (LocalErg = 0) And (Err.Number = 0) Then
+ If sRebootNeeded <> False Then
+ sRebootNeeded = sRebootNeeded & " | PendingFileRenameOperations"
+ Else
+ sRebootNeeded = "PendingFileRenameOperations"
+ End If
+ End If
+ Set objRegInt = Nothing
+
+ If sRebootNeeded = False Then sRebootNeeded = "No"
+ GetRebootStatus = sRebootNeeded
+End Function
+
+'----- Get RegKey-Value -----
+'Description: Determines the value of a RegValue
+'Usage: GetRegKeyValue , ,
+'Output: Value
+'Example: Value = GetRegKeyValue ("REG_SZ", "HKLM\Software\AudiAG\MeinTest\MeinKey", 32)
+'Parameters: : REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ, REG_DWORD, REG_QWORD, REG_BINARY
+' : 32, 64
+'----------------------------
+Function GetRegKeyValue(keyType, key, hive)
+ Dim oCtx, oLocator, oReg, oInParams, oOutParams
+ Dim hk, r, i, path, operation
+ Dim strValue, strTemp
+
+ Set oCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
+
+ If (hive = 32 Or hive = 64) Then oCtx.Add "__ProviderArchitecture", hive
+
+ Set oLocator = CreateObject("Wbemscripting.SWbemLocator")
+ Set oReg = oLocator.ConnectServer("", "root\default", "", "", , , , oCtx).Get("StdRegProv")
+
+ r = Split(key, "\")
+ r(0) = UCase(r(0))
+ If r(0) = "HKEY_CLASSES_ROOT" Or r(0) = "HKCR" Then
+ hk = &H80000000
+ ElseIf r(0) = "HKEY_CURRENT_USER" Or r(0) = "HKCU" Then
+ hk = &H80000001
+ ElseIf r(0) = "HKEY_LOCAL_MACHINE" Or r(0) = "HKLM" Then
+ hk = &H80000002
+ ElseIf r(0) = "HKEY_USERS" Or r(0) = "HKU" Then
+ hk = &H80000003
+ End If
+
+ path = Mid(key, Len(r(0)) + 2, Len(key) - Len(r(UBound(r))) - Len(r(0)) - 2)
+
+ If Left(UCase(keyType),4) <> "REG_" Then keyType = "REG_" + keyType
+ Select Case UCase(keyType)
+ Case "REG_SZ" : operation = "GetStringValue"
+ Case "REG_EXPAND_SZ" : operation = "GetExpandedStringValue"
+ Case "REG_MULTI_SZ" : operation = "GetMultiStringValue"
+ Case "REG_DWORD" : operation = "GetDWORDValue"
+ Case "REG_QWORD" : operation = "GetQWORDValue"
+ Case "REG_BINARY" : operation = "GetBinaryValue"
+ case Else : ErrorHandling 16000, "Function GetRegKeyValue: Unknown keytype"
+ End Select
+
+ Set oInParams = oReg.Methods_(operation).InParameters
+ oInParams.hDefKey = hk
+ oInParams.sSubKeyName = path
+ oInParams.sValueName = r(UBound(r))
+
+ Set oOutParams = oReg.ExecMethod_(operation, oInParams, , oCtx)
+
+ Select Case UCase(keyType)
+ Case "REG_SZ", "REG_EXPAND_SZ"
+ GetRegKeyValue = oOutParams.sValue
+ Case "REG_MULTI_SZ"
+ If Not IsNull(oOutParams.sValue) Then GetRegKeyValue = Join(oOutParams.sValue, "|")
+ Case "REG_BINARY"
+ For Each strValue in oOutParams.uvalue
+ If len (Hex(strValue)) < 2 Then
+ strValue = "0" & Hex(strValue)
+ Else
+ strValue = Hex(strValue)
+ End If
+ strTemp = strTemp & strValue & "|"
+ Next
+ If Right(strTemp, 1) = "|" Then strTemp = Left(strTemp, Len(strTemp) - 1)
+ GetRegKeyValue = strTemp
+ Case "REG_DWORD", "REG_QWORD"
+ GetRegKeyValue = oOutParams.uValue
+ End Select
+End Function
+
+'----- Get SCCMSiteCode -----
+'Description: Show the SCCM-Site-Code
+'Usage: GetSCCMSiteCode()
+'Output: SiteCode or "unknown"
+'----------------------------
+Function GetSCCMSiteCode()
+ On Error Resume Next
+ Dim oClient
+ Set oClient = CreateObject("Microsoft.SMS.Client")
+ If Err.Number <> 0 then
+ VbsLog "ERROR | Could not create SMS Client Object."
+ GetSCCMSiteCode = "unknown"
+ Else
+ GetSCCMSiteCode = UCase(oClient.GetAssignedSite)
+ End if
+ On Error Goto 0
+End Function
+
+'----- GetScriptArchitecture() -----
+' Description: Returns the script is run as 32 or 64Bit
+' Input: n/a
+' Output: 32 / 64 / unknown
+' Example: GetScriptArchitecture()
+' Author(s): AL
+' Last Edit: 02.05.2014
+'----------------------------
+Function GetScriptArchitecture()
+ Dim objFSO, WSHShell, EnvProc
+ Set objFSO = WScript.CreateObject("Scripting.Filesystemobject")
+ Set WshShell = WScript.CreateObject("WScript.Shell")
+ Set EnvProc = WSHShell.Environment("PROCESS")
+
+ Dim strComputer, objWMIService, objItem, colItems, iOS
+
+ strComputer = "."
+ Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
+ Set colItems = objWMIService.ExecQuery("SELECT SystemType FROM Win32_ComputerSystem",,48)
+ For Each objItem in colItems
+ If (objItem.SystemType = "x64-based PC") Then
+ iOS = 64
+ Else
+ iOS = 32
+ End If
+ Next
+ If iOS = 64 Then
+ If objFSO.FolderExists(EnvProc("winDir")) Then
+ If objFSO.FolderExists(EnvProc("winDir") & "\Sysnative") Then
+ GetScriptArchitecture = 32
+ Else
+ GetScriptArchitecture = 64
+ End If
+ Else
+ GetScriptArchitecture = "unknown"
+ End If
+ Else
+ GetScriptArchitecture = 32
+ End If
+End Function
+
+'----- Get Userlanguage -----
+'Description: Show the Userlanguage
+'Usage: GetUserLanguage()
+'Output: "DE", "HU", "EN", "FR", "ES", "IT", "unknown"
+'----------------------------
+Function GetUserLanguage()
+ If Left(GetOSVersion(),1) < 6 Then
+ Dim strTempLanguage
+ strTempLanguage = GetRegKeyValue("REG_SZ", "HKCU\Control Panel\Desktop\MUILanguagePending", 32)
+ If IsNull(strTempLanguage) Then
+ VbsLog "Information: RegKey not found 'HKCU\Control Panel\Desktop\MUILanguagePending'. Userlanguage is Clientlanguage"
+ strTempLanguage = GetLanguage()
+ End If
+ Select Case strTempLanguage
+ Case "00000407", "DE" 'Deutsch
+ GetUserLanguage = "DE"
+ Case "0000040e", "HU" 'Ungarisch
+ GetUserLanguage = "HU"
+ Case "00000409", "EN" 'Englisch
+ GetUserLanguage = "EN"
+ Case "0000040c", "FR" 'Franzsisch
+ GetUserLanguage = "FR"
+ Case "00000c0a", "ES" 'Spanisch
+ GetUserLanguage = "ES"
+ Case "00000410", "IT" 'Italienisch
+ GetUserLanguage = "IT"
+ Case Else
+ GetUserLanguage = "unknown"
+ End Select
+ Else
+ Select Case LCase(GetRegKeyValue("REG_MULTI_SZ", "HKCU\Control Panel\Desktop\PreferredUILanguages", 32))
+ Case "de-de"
+ GetUserLanguage = "DE"
+ Case "hu-hu"
+ GetUserLanguage = "HU"
+ Case "us-us", "en-us"
+ GetUserLanguage = "EN"
+ Case "fr-fr"
+ GetUserLanguage = "FR"
+ Case "es-es"
+ GetUserLanguage = "ES"
+ Case "it-it"
+ GetUserLanguage = "IT"
+ Case Else
+ GetUserLanguage = "unknown"
+ End Select
+ End If
+ VbsLog "Userlanguage: " & GetUserLanguage
+End Function
+
+'----- Infoblende -----
+'Description: Shows InfoPanel when no tasksequence is running
+'Usage: InfoBlende "xmlfile.xml"
+'Example: InfoBlende "" or InfoBlende "info.xml"
+'Returns: True if panel was shown, False if not
+'------------------------------
+Function InfoBlende(XML)
+ If CheckProc("TsBootShell.exe,TsmBootstrap.exe,TSManager.exe,TSProgressUI.exe,SMSBoot.exe") = True Then
+ VbsLog "Information | OSD-Installation or tasksequence is running. Panel skipped."
+ InfoBlende = False
+ Exit Function
+ End If
+
+ If XML = "" Then
+ run "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe","0"
+ Else
+ run "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe """ & XML & """","0"
+ End If
+
+ InfoBlende = True
+End Function
+
+'----- Infoblendenowait -----
+'Description: Shows InfoPanel when no tasksequence is running
+'Usage: Infoblendenowait "xmlfile.xml"
+'Example: Infoblendenowait "" or Infoblendenowait "info.xml"
+'Returns: True if panel was shown, False if not
+'------------------------------
+Function InfoBlendeNoWait(XML)
+ If CheckProc("TsBootShell.exe,TsmBootstrap.exe,TSManager.exe,TSProgressUI.exe,SMSBoot.exe") = True Then
+ VbsLog "Information | OSD-Installation or tasksequence is running. Panel skipped."
+ InfoBlendeNoWait = False
+ Exit Function
+ End If
+
+ If XML = "" Then
+ RunNoWait "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe"
+ Else
+ RunNoWait "Infoblende","Infoblende\AudiSysWrapper.exe /w Infoblende.exe """ & XML & """"
+ End If
+
+ InfoBlendeNoWait = True
+End Function
+
+'----- InstallCertificate -----
+'Description: Install certificates from folder "CertificateFolder"
+'Usage: InstallCertificate