Solved

set directory for prnmngr script

Posted on 2006-11-03
11
360 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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 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…

705 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