bugfixes
This commit is contained in:
parent
508cfb49be
commit
f347b3458d
@ -123,7 +123,7 @@ if "@%localadmin_password%" NEQ "@" (
|
||||
echo.
|
||||
tools\searchreplace %DRIVE%\autounattend.xml ___MYUSER___ "%MYUSER%"
|
||||
tools\searchreplace %DRIVE%\autounattend.xml ___MYNAME___ "%MYNAME%"
|
||||
tools\searchreplace %DRIVE%\autounattend.xml ___MYPASS___ "%MYPASS%"
|
||||
tools\searchreplace %DRIVE%\autounattend.xml ___MYPASS___ "%MYPASS%" /S
|
||||
tools\searchreplace %DRIVE%\autounattend.xml ___MYLANG___ "%LANG%"
|
||||
|
||||
if NOT EXIST %SOURCES%\%BOOTFILE% (
|
||||
|
@ -261,10 +261,6 @@ echo ### FINALIZING ###
|
||||
echo #####################
|
||||
echo.
|
||||
|
||||
rem set ALL permissions ...
|
||||
call %SystemDrive%\set-permissions.cmd
|
||||
echo.
|
||||
|
||||
rem enable updates again (doing it as late as possible) ...
|
||||
if %windows_updates% == 1 (
|
||||
call enable-updates.cmd
|
||||
|
@ -4,34 +4,49 @@
|
||||
; LICENSE : GPL
|
||||
; AUTHOR : Michael H.G. Schmidt
|
||||
; EMAIL : michael@schmidt2.de
|
||||
; DATE : 20210328
|
||||
; DATE : 20230220
|
||||
; ------------------------------------------------------------
|
||||
;
|
||||
|
||||
OpenConsole()
|
||||
|
||||
; check commandline ...
|
||||
If ( CountProgramParameters() <> 3 )
|
||||
Procedure Usage()
|
||||
ConsoleColor(14,0)
|
||||
PrintN("")
|
||||
PrintN("usage: searchreplace <filename> <oldstring> <newstring>")
|
||||
PrintN("usage: searchreplace <filename> <oldstring> <newstring> [/S]")
|
||||
PrintN("")
|
||||
ConsoleColor(15,0)
|
||||
PrintN("search a string in a file and replace all occurences")
|
||||
PrintN(" oldstring: string to search")
|
||||
PrintN(" newstring: string to replace")
|
||||
PrintN(" /S: silent/hide output (use this for passwords!)")
|
||||
ConsoleColor(7,0)
|
||||
PrintN("")
|
||||
End 99
|
||||
EndProcedure
|
||||
|
||||
; check commandline ...
|
||||
If ( CountProgramParameters() < 3 Or CountProgramParameters() > 4 )
|
||||
Usage()
|
||||
EndIf
|
||||
|
||||
; vars
|
||||
tempfile$ = workfile$ + "_T"
|
||||
silent=0
|
||||
|
||||
; get arguments ...
|
||||
workfile$ = ProgramParameter(0)
|
||||
oldstring$ = ProgramParameter(1)
|
||||
newstring$ = ProgramParameter(2)
|
||||
|
||||
; vars
|
||||
tempfile$ = workfile$ + "_T"
|
||||
; hide output
|
||||
If ( CountProgramParameters() = 4 )
|
||||
If (UCase(ProgramParameter(3)) = "/S" )
|
||||
silent=1
|
||||
Else
|
||||
Usage()
|
||||
EndIf
|
||||
EndIf
|
||||
|
||||
;
|
||||
; MAIN
|
||||
@ -52,7 +67,12 @@ If Not OpenFile(1, tempfile$, #PB_File_SharedWrite | #PB_File_NoBuffering)
|
||||
End 99
|
||||
EndIf
|
||||
|
||||
PrintN("working on [ "+ workfile$ +" ] and replacing string [ "+ oldstring$ +" ] With [ "+ newstring$ +" ] ...")
|
||||
If ( silent = 1 )
|
||||
PrintN("working on [ "+ workfile$ +" ] and replacing string [ "+ oldstring$ +" ] With [ ******** ] ...")
|
||||
Else
|
||||
PrintN("working on [ "+ workfile$ +" ] and replacing string [ "+ oldstring$ +" ] With [ "+ newstring$ +" ] ...")
|
||||
EndIf
|
||||
|
||||
Repeat
|
||||
; read a line ...
|
||||
line$ = ReadString(0)
|
||||
@ -75,6 +95,7 @@ DeleteFile(workfile$,#PB_FileSystem_Force)
|
||||
dummy = RenameFile(tempfile$, workfile$)
|
||||
|
||||
; IDE Options = PureBasic 5.73 LTS (Windows - x64)
|
||||
; CursorPosition = 54
|
||||
; FirstLine = 30
|
||||
; CursorPosition = 68
|
||||
; FirstLine = 49
|
||||
; Folding = -
|
||||
; EnableXP
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user