Hi Mus
This is because you have missed out a back slash...
The fso-copyfile line should look like this (with a \ after Application Data\ICAClient) :
fso.CopyFile "C:\Program files\Citrix\ICA Client\appsrv.ini", "C:\Documents and Settings\" & strUserName & "\Application Data\ICAClient\"
As far as overwriting goes, the CopyFile() method does not care if the file exists in the destination folder - it will overwrite it by default.
JG
Main Topics
Browse All Topics





by: Admin4XPPosted on 2007-09-12 at 06:10:48ID: 19875876
OK i think all you need to do is this:
leSystemOb ject")
ipt.Networ k")
On Error Resume Next
'Get the username of the currently logged on user
strUserName = GetUserName()
'If the user cannot be determined then display a warning
If (strUserName = "") Then
Msgbox ("Unable to determine the logged on user - Please contact the Helpdesk")
End If
Set fso = CreateObject("Scripting.Fi
fso.CopyFile "C:\Program files\Citrix\ICA Client\appsrv.ini", "C:\Documents and Settings\" & strUserName & "\Application Data\ICAClient\"
'Function to get the username of the currently logged on user
Function GetUserName
Set objNetwork = Wscript.CreateObject("WScr
'Get username
RC = objNetwork.UserName
'Set username variable
If RC <> "" Then
GetUserName = RC
'If username is not known then set variable to blank
Else
GetUserName = ""
End If
End Function
Try that and let me know if it works