password for localadmin is removed now on install media (security!)
This commit is contained in:
parent
9068fad4d2
commit
25829578cf
@ -4,8 +4,8 @@ set W10=c:\TEMP\W10
|
||||
set SOURCES=%W10%\sources
|
||||
set BOOTFILE=boot.wim
|
||||
set IMAGEFILE=install.wim
|
||||
rem set SCRIPT_SETTINGS=scripts\settings.cmd
|
||||
rem set COMPANY_SETTINGS=company\settings.cmd
|
||||
set SCRIPT_SETTINGS=scripts\settings.cmd
|
||||
set COMPANY_SETTINGS=company\settings.cmd
|
||||
set FOURGB=4294967296
|
||||
|
||||
IF %1.==. GOTO USAGE
|
||||
@ -35,10 +35,6 @@ rem get drive type (is it fat32 ?) ...
|
||||
for /f "tokens=5" %%A in ('@fsutil fsinfo volumeinfo %DRIVE%^|findstr /B "File System Name : "') do (@set DRIVETYPE=%%A)
|
||||
echo DRIVETPYE = [ %DRIVETYPE% ]
|
||||
|
||||
rem =====
|
||||
rem MAIN
|
||||
rem =====
|
||||
|
||||
rem check SOURCE for files LARGER 4 GB in case FAT32 was chosen ...
|
||||
if /i "%DRIVETYPE%" EQU "fat32" (
|
||||
for /f "tokens=*" %%F in ('"dir /S /B /A-D %W10%"') do if %%~zF GTR %FOURGB% (
|
||||
@ -58,6 +54,10 @@ if NOT EXIST %SOURCES%\%IMAGEFILE% (
|
||||
|
||||
)
|
||||
|
||||
rem =====
|
||||
rem MAIN
|
||||
rem =====
|
||||
|
||||
echo copying all files in [ %W10% ] to drive %DRIVE% ...
|
||||
robocopy %W10%\ %DRIVE% /MIR /256 /NDL /R:1 /J /XX
|
||||
|
||||
@ -92,6 +92,17 @@ echo.
|
||||
echo putting copytools script to %DRIVE% ...
|
||||
copy /Y image\CopyTools.cmd %DRIVE%\
|
||||
|
||||
echo.
|
||||
rem remove passwords from settings.cmd config files ...
|
||||
for %%A in (
|
||||
%DRIVE%\tools\%SCRIPT_SETTINGS%
|
||||
%DRIVE%\tools\%COMPANY_SETTINGS%
|
||||
) do (
|
||||
if EXIST %%A (
|
||||
tools\searchreplace %%A "^.*SET.*LOCALADMIN_PASSWORD.*=.*" "set localadmin_password=DELETED"
|
||||
)
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ======
|
||||
echo READY.
|
||||
|
@ -4,7 +4,7 @@
|
||||
; LICENSE : GPL
|
||||
; AUTHOR : Michael H.G. Schmidt
|
||||
; EMAIL : michael@schmidt2.de
|
||||
; DATE : 20230220
|
||||
; DATE : 20230223
|
||||
; ------------------------------------------------------------
|
||||
;
|
||||
|
||||
@ -17,12 +17,12 @@ Procedure Usage()
|
||||
PrintN("")
|
||||
ConsoleColor(15,0)
|
||||
PrintN("search a string in a file and replace all occurences")
|
||||
PrintN(" oldstring: string to search")
|
||||
PrintN(" oldstring: string to search (RegEx aware)")
|
||||
PrintN(" newstring: string to replace")
|
||||
PrintN(" /S: silent/hide output (use this for passwords!)")
|
||||
ConsoleColor(7,0)
|
||||
PrintN("")
|
||||
End 99
|
||||
End 1
|
||||
EndProcedure
|
||||
|
||||
; check commandline ...
|
||||
@ -78,7 +78,12 @@ Repeat
|
||||
line$ = ReadString(0)
|
||||
|
||||
; search and replace ...
|
||||
result$ = ReplaceString(line$, oldstring$, newstring$)
|
||||
If ( CreateRegularExpression(0,oldstring$,#PB_RegularExpression_NoCase|#PB_RegularExpression_AnyNewLine) )
|
||||
result$=ReplaceRegularExpression(0,line$,newstring$)
|
||||
Else
|
||||
PrintN("ERROR: regular expression not valid!")
|
||||
End 1
|
||||
EndIf
|
||||
|
||||
; write to tempfile ...
|
||||
WriteStringN(1, result$)
|
||||
@ -94,8 +99,9 @@ DeleteFile(workfile$,#PB_FileSystem_Force)
|
||||
; move tempfile in place of original file ...
|
||||
dummy = RenameFile(tempfile$, workfile$)
|
||||
|
||||
End 0
|
||||
|
||||
; IDE Options = PureBasic 5.73 LTS (Windows - x64)
|
||||
; CursorPosition = 68
|
||||
; FirstLine = 49
|
||||
; CursorPosition = 26
|
||||
; Folding = -
|
||||
; EnableXP
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user