Jump to content

[Newbie!] RunAs with "" in programpath


Recommended Posts

Hello everybody...

I'm trying to make a little script to add shared printers automaticly at session opening...

So, while searching on this forum, i found adprintx which lets me add network printers.

The problem is that when I have to install a printer my command line is : adprintx /c "\\myserver\myprinter"

And when I use Run command, the external program must be between " and ".

Can I escape " caracter, or is there a solution to not use " in the command????

Thanks a lot...

Edit : this is not RunAs command, but Run

Edited by Julien.alkaza
What????????
Link to comment
Share on other sites

Perhaps you are issuing a command after the Run() that relies on the printer being added.

You could try changing the Run() to RunWait(); if that doesn't work then I would suggest opening a command prompt (DOS box) and typing the exact same command there. Perhaps an error message will be shown.

Link to comment
Share on other sites

No, no, no & no!!!!! B)

Here is my exact code :

#include <Process.au3>
RunAsSet ( "Administrator", @Computername, "pass")
_RunDos('D:\ADPRINTX.exe /c "\\printserver\HP4050-Can"')
RunAsSet()

There is no error...Nothing happens!!!

When I use only command prompt with :

D:\ADPRINTX.exe /c "\\printserver\HP4050-Can"
It works!!

I don't know where is the problem!!!!

Thanks a lot!! :o

What????????
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...