Quote:

Please explain why for example InserLine() does not work for you?




Jens...

I tried the InsertLine() function and it didnt work properly. I ran this...

Code:
$null = insertline('file.txt',17,'alternate shell:s:d\integra\destiny\filename.exe -d "First One Database"',1)
$null = insertline('file.txt',18,'shell working directory:s:d\integra\destiny',1)

Function insertline($a, $b, optional $c, optional $d)
Dim $e,$f,$h,$x,$y
If $b<0 Exit -3 EndIf
If $c="" $d=1 EndIf
$f="%temp%\~kixil00.tmp" ; temporary file to use
Del $f
If $d<>1 $d=0 EndIf
$e=FreeFileHandle
$insertline=-2
If $e=0 Exit -2 EndIf
$insertline=Open($e,$a)
If $insertline<>0 Exit @Error EndIf
$h=FreeFileHandle
If $h=0
$insertline=-2
$x=Close($e)
Exit -2
EndIf
$insertline=Open($h,$f,5)
If $insertline<>0
$x=Close($e)
Exit @Error
EndIf
If $b<>0
For $x=0 To $b-1
$y=ReadLine($e)
If @Error<>0
$x=Close($e)
$x=Close($h)
Del $f
$insertline=-3
Exit -3
Else
$insertline=WriteLine($h,$y+@Crlf)
EndIf
Next
EndIf
$insertline=WriteLine($h,$c)
$y=ReadLine($e)
If @Error<>0
$x=Close($e)
$x=Close($h)
Del $f
$insertline=-3
Exit -3
EndIf
If $d=0
$x=WriteLine($h,$y+@Crlf)
EndIf
$y=ReadLine($e)
While @Error=0
$insertline=Writeline($h,$y+@Crlf)
$y=ReadLine($e)
Loop
$x=Close($e)
$x=Close($h)
Copy $f $a
Del $f
$insertline=0
Exit 0
EndFunction



And got this in the text file...

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"alternate shell:s:d\integra\destiny\filename.exe -d "First One Database"password 51:b:01000000D08C9DDF0115D1118C7A00C04FC297EB01000000D0D61E03189DD1488EFBD3B5A34D4BCA0000000008000000700073007700000003660000A8000000100000002B311A643CC3435C37FD822138D71DF70000000004800000A000000010000000EA4B93DAA6E81DCA6F98B27EC294FC2E0802000073D3267340AE74B3897F4543AD60E139E2F59559081A3C3B3D8E989F5ABC67949AD9F4AE7C092AD3DE5C15381F3373552BC983D81D33B8F85360FC417FA8764A452ACAC61DD3D618F245D0B7553382DA3A1E608A88FE588FE9B5E6A92C9AC7B97376E9E83384A5D35B98FCC326FECE095ACE37548DA1922367E22F57157EFECF326365798D8A78C58EF51CAF46342B23C847332C9A8FC703A1DA70B9D089BBC8780C2CF24E07EAEC165295EE3320214AC3C88996F568B6B1F265445D58FB6F93AA427171DF7DF6B14171E85A2A96A86BC71870A69271DC964544F9969994555BB652F4F4CAB3792A369FC55CC5B5B591E61FCA93CF6077B2343318328D192E40DB3B451FB3D8A9FB5D5F602D7BDD9C47D2E9378234CFA4E0DCF2E764273FAEBE38CE5123033BDA283117C267B090BAD11960BB7907A28EE30EFECF69277E7A2D47D91EFEC14D26CCBCE9E1520CFA4808FB414DF8B7E0C4FE924CD765F39F7BCC45A708120727F8EDABF1008B634C27E6D232FA4B1BD49B962D382A2ED255900BCE6A52DBEA79CB375945FD2A12C99701CB0E3E63294FE4EC0082AADF28F64BEA85E468CD807C7579101638FAA475D94BB9AB7D1BEF1C89B7887BEB01B9565A5DCFFDAF82C7B8DC92F7980050FB0D6044784EFE59DA0F8BB0C53D944764847FB3198A5BD146485FE6251B6F04721D61F42D07D117DEF2E9F0D3479250B3B53C288A1E9EE3F61D4D9014000000DD893FEBC278867030AB9DB367103EF8EDC4C907
shell working directory:s:d\integra\destinydisable menu anims:i:1
disable themes:i:0
bitmapcachepersistenable:i:1





Looks like something is off in this UDF...Could someone else try it and confirm its not just something I did?