Installing printers by computer names

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
penyel
Newbie
Posts: 3
Joined: Fri Jan 12, 2007 4:32 pm

Installing printers by computer names

Post by penyel » Fri Jan 12, 2007 6:29 pm

I am trying to tell another section of the scritp to install a printer if the name is found on the this list. Would it be possible to do it this way. I tested it and it works some of the times.

LET>SYSTEM=ABETHONEY
LET>SYSTEM=JARRIGOPC
LET>SYSTEM=DEACCOMP
LET>SYSTEM=ABETHONEY
LET>SYSTEM=EPEREZ
IF>COMPUTER_NAME=SYSTEM NOTE: IF Computer maches do this
run program>C:\Windows\system32\calc.exe
ELSE
run program>C:\Windows\SYSTEM32\NOTEPAD.EXE

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Jan 12, 2007 6:33 pm

Hi,

No, SYSTEM will only ever be set to EPEREZ

You could make an array, or just a delimited list would work in this case:

Code: Select all

Let>SYSTEM_LIST=ABETHONEY;JARRIGOPC;DEACCOMP;ABETHONEY;EPEREZ 
Position>COMPUTER_NAME,SYSTEM_LIST,1,InList
If>InList>0
  Run>calc.exe
Else
  Run>Notepad.exe
Endif
But perhaps you could explain what you are aiming to achieve and we can give you some ideas as to the best way to go about it. An array might be better, or you could use a text file list ....
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts