We help IT Professionals succeed at work.

vbscript will not run from network

namilf
namilf asked
on
Medium Priority
468 Views
Last Modified: 2012-05-06
The script runs from locally fine but when I try to push it out using SMS or run it from a network share it will not work.
Option Explicit
 
Dim objWSHShell	:Set objWSHShell = CreateObject("WScript.Shell") 
Dim objFSO		:Set objFSO = CreateObject("Scripting.FileSystemObject")	
Dim winDir		:winDir=objWSHShell.ExpandEnvironmentStrings("%winDir%")
Dim userProfile	:userProfile=objWSHShell.ExpandEnvironmentStrings("%userProfile%")
Dim oFS
Set oFS       = WScript.CreateObject("Scripting.FileSystemObject")
 
If oFS.FileExists(userProfile &"\Application Data\Microsoft\Excel\Excel11.xlb") then oFS.DeleteFile(userProfile & "\Application Data\Microsoft\Excel\Excel11.xlb")
If oFS.FileExists(userProfile &"\Application Data\Microsoft\PowerPoint\PPT11.pcb") then oFS.DeleteFile(userProfile & "\Application Data\Microsoft\PowerPoint\PPT11.pcb")
If oFS.FileExists(userProfile &"\Application Data\Microsoft\templates\normal.dot") then oFS.DeleteFile(userProfile & "\Application Data\Microsoft\templates\normal.dot")
If oFS.FileExists(userProfile &"\Application Data\Microsoft\Excel\Excel12.xlb") then oFS.DeleteFile(userProfile & "\Application Data\Microsoft\Excel\Excel12.xlb")
If oFS.FileExists(userProfile &"\Application Data\Microsoft\PowerPoint\PPT12.pcb") then oFS.DeleteFile(userProfile & "\Application Data\Microsoft\PowerPoint\PPT12.pcb")

Open in new window

Comment
Watch Question

Commented:
I would talk to the network administrator at your site and find out if their is a user policy that prevents them from running VB Scripts.  Most of the time if it runs locally on a development computer but not for users it is tied to the rights the user has on their computer.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.