Auto insert text in Run Command via Batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
wchristner
Posts: 24
Joined: 06 May 2014 09:55
Location: North West Indiana

Auto insert text in Run Command via Batch

#1 Post by wchristner » 08 May 2014 09:28

I got a batch file question. I am deploying many Computers in a local hospital, I want to auto insert text via batch file into the run command search field. I have the run command working so all i need to know is how to insert test.
Here is what I have so far:

@echo off
set /p printer=Enter Printer Name text:
hostname
@echo off
rundll32.exe shell32.dll #61
pause

This is the print server location I would like to open:
rundll32 printui.dll,PrintUIEntry /c\\COMPUTERNAME /ga /n \\PRINTERNAME/j"LanMan Print Servers"


The idea is a user runs the batch, and types in the printer name.
then an explorer window opens up to the printserver folder.
thats it.

I would like the Hostname to auto fill in the //COMPUTERNAME\

Any help would be appreciated

Thanks

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Auto insert text in Run Command via Batch

#2 Post by penpen » 08 May 2014 09:50

Do you search something like the following?

Code: Select all

echo rundll32 printui.dll,PrintUIEntry /c\\%COMPUTERNAME% /ga /n \\%printer%/j"LanMan Print Servers"
(The echo is just for debugging, remove it if the resulting instruction is, what you need.)

penpen

Post Reply