bringing me to the next problem =\..

\\server01\applic\Iconen\docent,%USERPROFILE%\Bureaublad\

Does Kix change %USERPROFILE% or %USERNAME% to the actual username or location?
for some weird reason, when i read this string from an ini file it won't actually copy it to that directory =\.

Code:

[Bestanden]
Inifile:
1=\\server01\applic\Iconen\docent,%USERPROFILE%\Bureaublad\



actual code:
Code:

$IniFile=@ScriptDir+"\Setup.ini"
$Amount_of_Files = ReadProfileString($IniFile,"Kopie","Aantal Bestanden")

Open (3 , "C:\KixLOG.TXT", 5)
WriteLine( 3 , "Script sessie gestart op " +@DATE+ " om " + @TIME + @CRLF )
WriteLine( 3 , "----------------------------" + @CRLF)
Close(3)

for $i=1 to $Amount_of_Files
$Current = $i
$Current = ReadProfileString($IniFile,"Bestanden",$i)
$File_Array = Split($Current,",")
if $File_Array[0] = ""
GOTO "EndFunc"
else
? "Bezig met kopieren van "+$File_Array[0]+" naar "+$File_Array[1]
Copy $File_Array[0] $File_Array[1]
if @error
? "Fout opgetreden bij het kopieren van "+$File_Array[0]+" naar "+$File_Array[1]
$Error_Count = $Error_Count+1
if Open( 3 , "C:\KixLOG.TXT", 5 ) = 0
WriteLine( 3 , "Fout bij kopieren van bestand: " + $File_Array[0] + " naar "+ $File_Array[1]+"."+ @CRLF)
$NoErr = 0
Close(3)

else
BEEP
$NoErr = 1
endif
else

endif
endif

next $i

:EndFunc
if $NoErr = 1
if $Error_Count <> 0
? "Er zijn "+$Error_Count+" fout(en) opgetreden, helaas kon er geen logbestand aangemaakt worden."+@CRLF
else
? "Opdracht uitgevoerd."
endif

else
if $Error_Count <> 0
? "Er zijn "+$Error_Count+" fouten opgetreden, "+@CRLF+"voor meer informatie kunt u het logbestand raadplegen op: C:\KixLOG.TXT" +@CRLF
Open(3, "C:\KixLOG.TXT", 5)
WriteLine( 3 , "----------------------------" + @CRLF)
else
? "Opdracht uigevoerd."+@CRLF
Open(3, "C:\KixLOG.TXT", 5)
WriteLine( 3 , "Succesvol uitgevoerd" + @CRLF)
WriteLine( 3 , "----------------------------" + @CRLF)
endif
endif




for some weird reason it doesnt change the %USERNAME% to the actual username..
also i noticed you dont have a Replace function in Kixscript ( or i totally read over it.. in that case i apologise ! ).

i was going to solve this by searching for the string %USERNAME% and replacing that with @USERID.. which should have done the trick ( if the problem actually is where i think it is ).


PS:
AmountOfFiles is just a variable defining how many files or directories are to be copied it is defined properly in the ini file, so no problems there.


thanks again for your support so far!


Edited by J4zen (2005-12-16 11:59 AM)