Can anyone identify why the rename process does not work. I am having to use the CMD line to post process .new to .ini...
Code:
break on
$SD=%SystemDrive%
$ATTR = GETFILEATTR('$SD + "\boot.ini"')
IF Open(1, $SD + "\boot.ini",2) = 0
If exist($SD + "\boot.new")
del '$SD + "\boot.new"' /c /f /h
endif
IF Open(2, $SD + "\boot.new",5) = 0
$IN = readline(1)
While Not @ERROR
if left($IN,5) = "multi" and right($IN,3) <> "3gb"
$array = split($IN,'"',-1)
$OUT = WRITELINE (2,$array[0]+'"'+$array[1]+' /3gb"'+$array[2]+' /3gb'+ @CRLF)
$OUT = WRITELINE (2,$IN + @CRLF)
else
if left($IN,8) = "timeout=" $IN = "timeout=10" endif
$OUT = WRITELINE (2,$IN + @CRLF)
endif
$IN = readline(1)
loop
close (2)
close (1)
If exist($SD + "\boot-old.ini")
del '$SD + "\boot-old.ini"' /c /f /h
endif
if ($x = SETFILEATTR('$SD + "\boot.ini"',128)) = 0
move '$SD + "\boot.ini"' '$SD + "\boot-old.ini"' /h /r
if @error = 0
move '$SD + "\boot.new"' '$SD + "\boot.ini"' /h /r
$x = SETFILEATTR('$SD + "\boot.ini"',$ATTR)
endif
endif
endif
endif