Question : VBS script help needed

Hi,

We are using the following script so that a file will be copied over a computer if an specific file exists for that computer and no footprint has been found.

The problem that we are facing is that file has to be copied under the user user profile

"C:\Documents and Settings\testuser\Application Data\IEPro"

which means that this is not a static location and the path will be changing based on the user that has done logon.

Could someone help me to change the code so that the script could find the logged on user and build the path and copy the file over.
 

Thank you.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
'IEPRO7 disable automatic updates

Set objShell = CreateObject("WScript.Shell") 
Set objFSO = CreateObject("Scripting.FileSystemObject") 
strRegFileIE7PRO = "\\dc1\SYSVOL\domain.Local\scripts\conf.ini"
strFileIEPRO= "C:\Program Files\IEPro\IEProCx.exe" 
strAppData = objShell.ExpandEnvironmentStrings("%APPDATA%") 
strCheckFileIEPRO = strAppData & "\IEPRO7updatesdisabled.dat"


If objFSO.FileExists(strFileIEPRO) then 

  If objFSO.FileExists(strCheckFileIEPRO) = False Then 
	objFSO.CopyFile "\\dc1\SYSVOL\domain.Local\scripts\conf.ini" , "C:\Documents and Settings\testuser\Application Data\IEPro"
        Set objFile = objFSO.CreateTextFile(strCheckFileIEPRO, True) 
        objFile.Close 
End If

Answer : VBS script help needed


do while stackTable.Count <> 0
   messagebox.show( stackTable.Pop)
loop
Random Solutions  
 
programming4us programming4us