-
Notifications
You must be signed in to change notification settings - Fork 6
/
Install Win7.bat
45 lines (35 loc) · 1.19 KB
/
Install Win7.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
if '%1' NEQ 'ELEV' (
echo Requesting administrative privileges...
goto UACPrompt
) else (
exit /B -1
)
) else (
goto gotAdmin
)
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "ELEV", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd %~dp0
FOR %%A IN (*.xml *.dll) DO (echo.>%%A:Zone.Identifier)
FOR /F "usebackq tokens=2,* skip=2" %%L IN (
`reg query "HKLM\SOFTWARE\WOW6432Node\SRC\Alteryx" /v InstallDir64`
) DO SET alteryxPath=%%M
IF "%alteryxPath%" NEQ "" (
xcopy /Y *.xml "%alteryxPath%\RuntimeData\FormulaAddIn"
xcopy /Y *.dll "%alteryxPath%\RuntimeData\FormulaAddIn"
)
FOR /F "usebackq tokens=2,* skip=2" %%L IN (
`reg query "HKCU\SOFTWARE\SRC\Alteryx" /v InstallDir64`
) DO SET alteryxPath=%%M
IF "%alteryxPath%" NEQ "" (
xcopy /Y *.xml "%alteryxPath%\RuntimeData\FormulaAddIn"
xcopy /Y *.dll "%alteryxPath%\RuntimeData\FormulaAddIn"
)
popd