?
Solved

set directory for prnmngr script

Posted on 2006-11-03
11
Medium Priority
?
361 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 2000 total points
ID: 17867689
When you run your script
cscript %windir%\system32\prnmngr.vbs -x
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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

770 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