Get url

Get url

Postby Todd Yingling » Tue Jul 24, 2012 9:20 am

Hello,

I am writing a script where it would be helpful if I could tell what environment I am in: build, test, production. I really don't want to hard code the environment in the script.

Does anyone know how to obtain this information from a vbscript or anyway really? I thought it would be easy to grab the url somehow, which has the server name. I can parse that to determine what environment the code is running in.

Any help is appreciated.

Thanks,
Todd
Todd Yingling
 
Posts: 17
Joined: Mon Apr 04, 2011 12:11 pm

Re: Get url

Postby rlape » Tue Jul 24, 2012 11:15 am

This guy should get you the hostname of the machine it is executed from.

function Hostname()
Set wshShell = CreateObject( "WScript.Shell" )
strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
Hostname=strComputerName
end function

Will that work for you?
Ray Lape | Senior Consultant
Galen Healthcare Solutions
ray.lape@galenhealthcare.com
rlape
 
Posts: 40
Joined: Wed Mar 30, 2011 12:34 pm
Location: Burlington, KY

Re: Get url

Postby Todd Yingling » Tue Jul 24, 2012 11:46 am

Indeed, that worked perfectly.
Thank you!
Todd Yingling
 
Posts: 17
Joined: Mon Apr 04, 2011 12:11 pm


Return to Tools: Queries, Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron