Solved

set directory for prnmngr script

Posted on 2006-11-03
11
356 Views
Last Modified: 2008-02-01
simple thing i have this script to clear all printers:

cscript prnmngr.vbs -x
 

but i cant figure out how to set the directory to systemroot\system32 so it can find prnmngr.vbs
0
Comment
Question by:bjv211
  • 7
  • 4
11 Comments
 
LVL 20

Expert Comment

by:hes
ID: 17867216
%windir%\system32\prnmngr.vbs
0
 
LVL 1

Author Comment

by:bjv211
ID: 17867624
can you post the whole vb?
0
 
LVL 20

Accepted Solution

by:
hes earned 500 total points
ID: 17867689
When you run your script
cscript %windir%\system32\prnmngr.vbs -x
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:bjv211
ID: 17867775
ohhh now i get it thanks :) i was putting the directory before cscript
0
 
LVL 1

Author Comment

by:bjv211
ID: 17867806
i get his error:

Line 1
Char 9
Error  Invalid character
0
 
LVL 1

Author Comment

by:bjv211
ID: 17881873
any response on this?
0
 
LVL 20

Expert Comment

by:hes
ID: 17884034
That error is in your prnmngr.vbs file
0
 
LVL 1

Author Comment

by:bjv211
ID: 17884158
no i dont believe it is.  if i take the path out and put the vbs in the same directory as  prnmngr.vbs it runs fine.
0
 
LVL 20

Expert Comment

by:hes
ID: 17884613
Ok didn't know you are running the first in another .vbs fiel
Try this in the first .vbs

Dim fso
Dim strFolderName
Dim WshShell
set fso = CreateObject("Scripting.filesystemobject")
strFolderName = fso.GetSpecialFolder(WindowsFolder)
strFolderName = strFolderName  &  "\system32\prnmngr.vbs -x"

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run (strFolderName)

set fso = nothing
set wshShell = nothing
0
 
LVL 1

Author Comment

by:bjv211
ID: 17884696
oh i didnt know i could do the other option.  obviously i'm a lil lost with vbs.  is one way better?
0
 
LVL 1

Author Comment

by:bjv211
ID: 17884722
nevermind i was confusing 2 things.  i just needed to use *.bat to execute the prnmngr.vbs.  thanks for your patience
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

809 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