.CopyFile to User TEMP - Permission Denied??



Hi,

I cant copy a file to a users %TEMP% variable using vbscript? I have
tried many different combinations of code but i am always stumped with
a Permissions Denied error.
I am running and testing this script from my local desktop and a full
admin account so i do not understand at all??

Here is one version of script i have tried:
================================
Dim wshShell,strUserTemp,wshSysEnv,objFSO

Set objFSO = CreateObject("scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("USER")

strUserTemp=WshSysEnv("TEMP")
wscript.echo WshShell.ExpandEnvironmentStrings(strUserTemp)

objFSO.CopyFile "source file location here" ,
WshShell.ExpandEnvironmentStrings(strUserTemp)
===================================

This one is more elaborate than a few I have tried but still same
problem?
I must be missing something but not sure what?

To note, basically this is part of my AD logon script and need to copy
a file to the users local pc and then execute it. But at this stage i
cant get the file across (root is locked down so im guessing temp
should work?).

Many thanks if somebody could help me out.

Rich.

.



Relevant Pages


Loading