Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Scripting questions  (Read 2368 times)

0 Members and 1 Guest are viewing this topic.

Pr0FiT

    Topic Starter


    Rookie
    Scripting questions
    « on: December 09, 2006, 05:34:57 PM »
    Not really a DOS question but a scripting one.

    I am writing a small script to automate some things around the office and i'm stuck on one part. What I want the script to do is parse a variable into the command below:

    rundll32 printui.dll,PrintUIEntry /in /q /n<variable goes here>

    The variable needs to be a \\printerserver\printer. It works okay if I use %1 and just start the batch file with the variable behind it but I'd rather have it prompt for the printerserver/share name. I tried doing a "set /p %printer%=" but that doesn't seem to work, the command executes blank w/ the "%printer%" variable after the "/n" in the command. Any help? All of the clients this will be ran on are XP and 2K.

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: Scripting questions
    « Reply #1 on: December 09, 2006, 05:57:04 PM »
    Code: [Select]
    set /p printer=Please enter server\share name:
    rundll32 printui.dll,PrintUIEntry /in /q /n%printer%

    Change the prompt as needed. Wasn't sure if the printer name abuts the /n switch, if not add a space between /n and %printer%.

    Good luck. 8-)
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein

    Pr0FiT

      Topic Starter


      Rookie
      Re: Scripting questions
      « Reply #2 on: December 09, 2006, 05:58:08 PM »
      I'm a fool, I figured it out right after posting this. When I was doing the set command I put "%printer%" instead of "printer" which is why the var wasn't working. Stupid me!