Set Default Printers for Citrix users based on location (gateway or IP of client PC)

Good Evening Experts,

I want to use KIX login or login script that when a citrix user logs in from a workstation at a site (we have several sites), that the local client IP or gateway is captured and then printers are mapped based on the client PC location (obtained from the IP or Gateway address).  I know you can use KIX login scripts to do this using enumerateipinfo but I am lost configuring I tried to use this code to get gateway address of the client which works, but i get an error %%x not expected when I run it.
ipconfig|find /i "gateway" > c:\gateway.tmp
for /f "tokens=2 delims=:" %%x in (gateway.tmp) do set mygate = %%x
If "gateway" = then.... (here i would map printers and set default)

Anyone can steer me in the right direction I would greatly appreciate it!!!


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You should be able to do this with WMI and VBScript...there is a property you can call to return the client IP, stuff it into a variable and run it against a case statment.  

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
premiertechllcAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Server OS

From novice to tech pro — start learning today.