Problem with a VBScript
I'm using a WSC VBScript to install several applications on 70 Vista laptop computers. I know that some of these require elevation, so I put the following lines into the start of the script: ' Make sure the script runs as administrator...If WScript.Arguments.length = 0 Then Set objShell = CreateObject("Shell.Application") 'Pass a bogus argument with leading blank space objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " UAC_PROMPT", "", "runas", 1 WScript.Quitend If This works extremely well... on most of the computers. On just a few computers, later on in the script where I need to delete some files in a Program Files subfolder, I get an "Access Denied" error. The user is an Administrator, and UAC is turned on. I tried running the script from a command prompt, started as "Run as administrator," and the same thing happend. Any clues as to why this is happening, and what I can do about it? TIA!! Martin
October 15th, 2008 8:51pm

Hi,What files are you trying to delete? Have you tried taking ownership (takeown /? or takeown /f folder) of the sub-folder first? That usually does the trick.
Free Windows Admin Tool Kit Click here and download it now
October 15th, 2008 9:23pm

Thanks for the response! I'm trying to delete all of the files in the folder, including the executables. I had never heard of "takeown". I'll give it a try. Thanks! Martin
October 15th, 2008 11:23pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics