Chinasmoker Posted October 7, 2008 Posted October 7, 2008 i ve a script that needs to modify a file,and this file needs to open as a text , The name of this file is 'systemconfig.properties' follow is this file CODE//\u8d44\u4ea7\u7ba1\u7406\u542f\u52a8\u914d\u7f6e On\u4e3a\u542f\u52a8 Off\u4e3a\u4e0d\u542f\u52a8 AssetOnOff=On SupportES=Off question : i need to modify 'AssetOnOff=On' to'AssetOnOff=Off' ,but i cannt find a suitable function follow my script CODE$reg = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Hintsoft\PubwinServer","basedir");get the path of this file $file = FileOpen ($reg &"\appServ\server\webapps\NetCafe\WEB-INF\classes\systemconfig.properties",0) ;file open $line1 = FileReadLine ($file,2) ;read the line i need $line1_spi= StringSplit($line1,"=");split the string as '=' if $line1_spi[2] = "On" Then $newstrin = StringReplace($line1_spi[2],"On","Off") EndIf One is never too old to learn
Recommended Posts