Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to open a shared print queue in vbscript

Status
Not open for further replies.

PaulCheeseman

Technical User
Dec 8, 2009
8
GB
I am trying to open an explorer window at a shared print queue with vbscript, and keep getting an error that the queue is not accesable, or have no permissions.

If I type \\servername\PrintQueueName under start/run, it works.

I tried the method shown on this thread
thread329-1371839

If I remove the queue name, and just use \\server, I get a list of all shares, but the same failure for the actual queue I am after.

Code:
Option Explicit
Const vbNormalFocus = 1
Const PathToOpen = "\\server"
Const Q = "\ReceptionReports"

WScript.CreateObject("WScript.Shell").Run _
  "explorer.exe /n,/root,""" & PathToOpen & Q & """", vbNormalFocus

I do have full permissions on that server, and of course locally.

Any suggestions?
 
What about this ?
Code:
WScript.CreateObject("WScript.Shell").Run """" & PathToOpen & Q & """"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for your reply

This gives the message 'unable to find file specified'

if I drop the Q part, it still opens the whole list of shares for that server, but refuses to open the specific one :(

Code:
WScript.CreateObject("WScript.Shell").Run """" & PathToOpen & Q & """"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top