.CopyFile to User TEMP - Permission Denied??
- From: "TB Rich" <xsipug@xxxxxxxxxxx>
- Date: 27 Jun 2006 07:49:11 -0700
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.
.
- Prev by Date: Re: Script to know the user logged onto the machine
- Next by Date: Re: vbscript encoder
- Previous by thread: resolve exchange 2000 public folder conflicts with vbs
- Next by thread: emailing in VBScript
- Index(es):
Relevant Pages
|
Loading