Solved

set directory for prnmngr script

Posted on 2006-11-03
11
354 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
 
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now