SEANS...
Try this code and see if it does the trick.
Code:
Break On
$null = SetOption ('NoVarsInStrings','On')
$null = SetOption ('Explicit','On')
Dim $null,$texttoreplace,$textreplacement,$inputfile,$inputhandle,$outputfile,$outputhandle,$line,$beforetext,$aftertext
$texttoreplace = '\\servername\c\'
$textreplacement = 'd\'
$inputfile = 'file.txt'
$inputhandle = FreeFileHandle()
If Open ($inputhandle, $inputfile) = 0
$outputfile = '%temp%\kxoutputfile.tmp'
$outputhandle = FreeFileHandle()
If Open ($outputhandle, $outputfile, 5) = 0
$line = ReadLine ($inputhandle)
While @Error = 0
If InStr ($line, $texttoreplace)
$beforetext = SubStr ($line, 1, InStr ($line,$texttoreplace)-1)
$aftertext = SubStr ($line, InStr ($line,$texttoreplace)+Len ($texttoreplace))
$line = $beforetext+$textreplacement+$aftertext
Endif
$null = WriteLine ($outputhandle, $line+@CRLF)
$line = ReadLine ($inputhandle)
Loop
$null = Close ($outputhandle)
Else
$null = MessageBox ('Unable to open the Output file','Error',0)
Endif
$null = Close ($inputhandle)
If Exist ($outputfile) and GetFileSize ($outputfile) > 0
Copy $outputfile $inputfile
Del $outputfile
Endif
Else
$null = MessageBox ('Unable to open the Input file','Error',0)
Endif
It resulted in the following file when run on my laptop...
Quote:
screen mode id:i:2
desktopwidth:i:1024
desktopheight:i:768
session bpp:i:8
winposstr:s:0,1,0,0,878,716
auto connect:i:0
full address:s:termserv1.ghmc.net
compression:i:1
keyboardhook:i:2
audiomode:i:0
redirectdrives:i:0
redirectprinters:i:0
redirectcomports:i:0
redirectsmartcards:i:1
displayconnectionbar:i:1
username:s:username
domain:s:domain
alternate shell:s:d\integra\destiny\filename.exe -d "First One Database"
shell working directory:s:d\integra\destiny
password 51:b:01000000D08C9DDF0115D1118C7A00C04FC297EB01000000D0D61E03189DD1488EFBD3B5A34D4BCA0000000008000000700073007700000003660000A8000000100000002B311A643CC3435C37FD822138D71DF70000000004800000A000000010000000EA4B93DAA6E81DCA6F98B27EC294FC2E0802000073D3267340AE74B3897F4543AD60E139E2F59559081A3C3B3D8E989F5ABC67949AD9F4AE7C092AD3DE5C15381F3373552BC983D81D33B8F85360FC417FA8764A452ACAC61DD3D618F245D0B7553382DA3A1E608A88FE588FE9B5E6A92C9AC7B97376E9E83384A5D35B98FCC326FECE095ACE37548DA1922367E22F57157EFECF326365798D8A78C58EF51CAF46342B23C847332C9A8FC703A1DA70B9D089BBC8780C2CF24E07EAEC165295EE3320214AC3C88996F568B6B1F265445D58FB6F93AA427171DF7DF6B14171E85A2A96A86BC71870A69271DC964544F9969994555BB652F4F4CAB3792A369FC55CC5B5B591E61FCA93CF6077B2343318328D192E40DB3B451FB3D8A9FB5D5F602D7BDD9C47D2E9378234CFA4E0DCF2E764273FAEBE38CE5123033BDA283117C267B090BAD11960BB7907A28EE30EFECF69277E7A2D47D91EFEC14D26CCBCE9E1520CFA4808FB414DF8B7E0C4FE924CD765F39F7BCC45A708120727F8EDABF1008B634C27E6D232FA4B1BD49B962D382A2ED255900BCE6A52DBEA79CB375945FD2A12C99701CB0E3E63294FE4EC0082AADF28F64BEA85E468CD807C7579101638FAA475D94BB9AB7D1BEF1C89B7887BEB01B9565A5DCFFDAF82C7B8DC92F7980050FB0D6044784EFE59DA0F8BB0C53D944764847FB3198A5BD146485FE6251B6F04721D61F42D07D117DEF2E9F0D3479250B3B53C288A1E9EE3F61D4D9014000000DD893FEBC278867030AB9DB367103EF8EDC4C907
disable wallpaper:i:1
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:0
bitmapcachepersistenable:i:1
If this look right...You should be good to go. Just change the $inputfile = 'file.txt' line in the script to point to the file you are trying to change. And be sure to make a backup of the file first...I dont want you blaming me if it does something wrong.