[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

vbscript will not run from network

Posted on 2009-02-11
1
Medium Priority
?
453 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

0
Comment
Question by:namilf
1 Comment
 
LVL 5

Accepted Solution

by:
mlaise earned 150 total points
ID: 23652140
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.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question