Microsoft
Software
Hardware
Network
Question : Enhancing a VB script to check hostname of the PC before running
I have the following working VB script that will send SMS / message via the
Telco's portal.
But I need an enhancement : to check at the beginning of the script if the hostname
of the Win XP PC is "abcdefgh"; if not, then stop executing the rest of the codes
==========================
==========
==========
======
strMobile = "97888888"
strMessage = "This is a test message"
Set objIE = CreateObject("InternetExpl
orer.Appli
cation")
objIE.Navigate "
http://sms.singtel.com/in
ternetsms/
"
objIE.Visible = True
Do While objIE.Busy
WScript.Sleep 2000
Loop
objIE.Document.LoginForm.I
tem("email
").Value = "
[email protected]
"
objIE.Document.LoginForm.I
tem("passw
ord").Valu
e = "mypassword"
objIE.Document.LoginForm.s
ubmit
Do While objIE.Busy
WScript.Sleep 2000
Loop
objIE.Document.startChatFo
rm.Item("m
obile").Va
lue = strMobile
objIE.Document.getElementB
yID("submi
t").Click
WScript.Sleep 10000
strURL = "
http://sms.singtel.com/in
ternetsms/
sendMsg.do
?id=1&
reci
pient=
"
intCounter = 0
Set objShell = CreateObject("Shell.Applic
ation")
Set objShellWindows = objShell.Windows
Do While intCount <= 10
For each objWindow in objShellWindows
If Instr(objWindow.LocationUR
L, strURL) Then
StrPopupURL = objWindow.LocationURL
Exit Do
End If
Next
intCount = intCount + 1
If intCount = 10 Then
objIE.Navigate "
http://sms.singtel.com/in
ternetsms/
logoutActi
on.do
"
WScript.Echo "The script was not able to find the popup window. Script Quitting"
WScript.Quit
End If
Sleep 2000
Loop
Set objIE_Pop = CreateObject("InternetExpl
orer.Appli
cation")
objIE_Pop.Navigate strPopupURL
objIE_Pop.Visible = True
Do While objIE_Pop.Busy
WScript.Sleep 2000
Loop
objIE_Pop.Document.getElem
entByID("m
essage").V
alue = strMessage
objIE_Pop.Document.getElem
entByID("s
ubmit").cl
ick
Do While objIE_Pop.Busy
WScript.Sleep 2000
Loop
WScript.Sleep 10000
For each objWindow in objShellWindows
If Instr(objWindow.LocationUR
L, strURL) Then
objWindow.Quit
End If
Next
objIE.Navigate "
http://sms.singtel.com/in
ternetsms/
logoutActi
on.do
"
Do While objIE.Busy
WScript.Sleep 2000
Loop
objIE.Quit
set objIE = nothing
set objIE_Pop = nothing
set objShellWindows = nothing
set objShell = nothing
Answer : Enhancing a VB script to check hostname of the PC before running
Yes, you cannot do that in 2003
Random Solutions
Access / how many users connected?
Issue with Email reporting in Windows SBS 2008
Microsoft Outlook 2007 is pulling duplicate emails from free hotmail live server - how can I prevent this, its driving me mad.
How do I restore my Exchange 2003 Virtual Directory Settings back to Default
Juniper SA2500 SSL VPN and Windows 2008 R2 firewall problem
Inter Process Communication between two VB.NET applications
2GB of RAM laptop only recognizing 1GB
trying to print to HP laserjet 2050 - and constantly have to hit "ok" button to print
Security Enabling basic Authentication for EWS
Update HP onboard administrator SSH version?