Skatterbrainz Blog: Calling a URL from WinPE / DaRT Environment

Calling a URL from WinPE / DaRT Environment

So maybe you find a need to call a URL from a WinPE or DaRT session (yes, I know, DaRT is a modified WinPE), but without IE or a browser you find it a challenge. Fear not. There are options at your disposal. Option 1 is to install a light-weight browser into your WinPE bundle, like Bart’sPE did/does. Firefox is a fairly common choice for that, but if you can get another browser to do that you have that option. Option 2 is to invoke the XMLHttp object via script. You can do that with VBscript since wscript/cscript components are part of WinPE and DaRT. The nice thing about this is with XMLhttp, you essentially have a browser but without the GUI. You call URL’s and even fetch (i.e. “scrape”) the return HTML results if needed #I do that a lot and may post some examples soon## A command-line browser, sort of# Here’s an example of option 2 – calling an ASP page with parameters… url = “http://myserver#domain#com/loginfo#asp?c=Workstation123&os=Windows7&ts=Enterprise32b” On Error Resume NextSet ohttp = CreateObject(“Microsoft.XmlHttp”)oHttp.open “GET”, url, FalseIf err.Number 0 Then wscript.Echo “fail: unable to open remote URL for asset number!” wscript.Echo “fail: error is ” & err.Num

via Skatterbrainz Blog: Calling a URL from WinPE / DaRT Environment.

Advertisements

Tagged:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

smsagent

Tips, tricks and time-savers for the Windows and ConfigMgr administrator

To The Point

Anything about Technology and Business

Brian's Power Windows Blog

Microsoft in the Enterprise. Windows, Hyper-V, Exchange, SQL, and more!

PowerScripting Podcast

Shownotes and links for the PowerScripting Podcast, a podcast to help people learn Windows Powershell

Learn Powershell | Achieve More

What is this Powershell of which you speak?

%d bloggers like this: