How to set online/offline via a vbs script?

L

Lee C.

I'm going to go set up a new e-mail program for my mother here next weekend on my little brother's computer, not the one coming, but the one after, so I have time to practice on this and get it right perhaps. (It's a couple hundred miles, so I want to have the trick down pat when I get there).

Notion is to get her arranged so's she can draft her e-mails offline so's she doesn't lose them into the ether as has been happening with the web mail my little brother set up for her. A Hotmail account and an OE identity seems to be a promising way to handle this, but I'll need for OE to come up in offline mode even after little brother has been browsing in the interim. Doesn't seem to be too hard a trick. I have an old vbs script I got from, I think, MVP Doug Knox's site that I've edited selectively, and it'll set for my Mother's identity and then open an .EML file preset to a type style amenable to her older eyes. The only thing is I don't know anything about vbs scripting, and am stuck on a point I haven't been able to figure out by the trial and error method.

The script as edited goes like this:

Set WshShell = WScript.CreateObject("Wscript.Shell")

'Clear the values from the registry
WshShell.RegWrite "HKCU\Identities\Last Username", "Momma"
WshShell.RegWrite "HKCU\Identities\Last User ID", "{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Default User ID", "{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Start As", "{584094C3-8546-49AC-AB6D-04C2A776AF0D}"

[hereabouts is where I get lost]

WSHShell.Run "d:\winxp\forms\eml-form.eml"

Into the part where I get lost I need to insert something to get OE to start offline even though little brother may have set it for online during the meantime. I have found the key that controls this to be:

HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\GlobalUserOffline

And I've figured out that switching the value back and forth from 0 to 1 causes OE (and I presume IE also) to load up either offline or online

However at this point I'm out of my depth. I have yet to even figure out what exactly a DWord is in the first place, nor have I been able to stumble across the command line for the vbs script that will cause it to switch to offline mode before it loads up that eml-form.eml file.

Can somebody enlighten me as to how to change that DWord value to 1 via a vbs script?
 
K

Kelly

Hi Lee,

Here is one way:

Option Explicit

Dim WSHShell, n, p, itemtype, MyBox
p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline"
itemtype = "REG_DWORD"
n = 0

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite p, n, itemtype

MyBox = MsgBox("User is now Offline" , 4096)

Here is another:

Set WSHShell = WScript.CreateObject("WScript.Shell")

P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
WshShell.RegWrite p1 & "GlobalUserOffline", 1, "REG_DWORD"

/top10faqs.htm


I'm going to go set up a new e-mail program for my mother here next weekend
on my little brother's computer, not the one coming, but the one after, so I
have time to practice on this and get it right perhaps. (It's a couple
hundred miles, so I want to have the trick down pat when I get there).

Notion is to get her arranged so's she can draft her e-mails offline so's
she doesn't lose them into the ether as has been happening with the web mail
my little brother set up for her. A Hotmail account and an OE identity
seems to be a promising way to handle this, but I'll need for OE to come up
in offline mode even after little brother has been browsing in the interim.
Doesn't seem to be too hard a trick. I have an old vbs script I got from, I
think, MVP Doug Knox's site that I've edited selectively, and it'll set for
my Mother's identity and then open an .EML file preset to a type style
amenable to her older eyes. The only thing is I don't know anything about
vbs scripting, and am stuck on a point I haven't been able to figure out by
the trial and error method.

The script as edited goes like this:

Set WshShell = WScript.CreateObject("Wscript.Shell")

'Clear the values from the registry
WshShell.RegWrite "HKCU\Identities\Last Username", "Momma"
WshShell.RegWrite "HKCU\Identities\Last User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Default User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Start As",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"

[hereabouts is where I get lost]

WSHShell.Run "d:\winxp\forms\eml-form.eml"

Into the part where I get lost I need to insert something to get OE to start
offline even though little brother may have set it for online during the
meantime. I have found the key that controls this to be:

HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline

And I've figured out that switching the value back and forth from 0 to 1
causes OE (and I presume IE also) to load up either offline or online

However at this point I'm out of my depth. I have yet to even figure out
what exactly a DWord is in the first place, nor have I been able to stumble
across the command line for the vbs script that will cause it to switch to
offline mode before it loads up that eml-form.eml file.

Can somebody enlighten me as to how to change that DWord value to 1 via a
vbs script?
 
L

Lee C.

Thanks darlin',

I haven't been able to get the second option to work yet (seemed to get it to work once, but then not again when I reset OE to online and tried it again--don't know if I mistook what happened the first time or what exactly is going on there--may tinker with it some more later and see if I can understand why it's not working for me). That "another", second way appears to my uneducated eye to be a way to create a key that previously didn't exist, but I'm sure I'll figure it out better if I tinker 'round with it some more. Possible I'm getting a word wrap in the text you provided that I'm not finding yet.

However, the "one way", with a few WAGs at it, is working for me. I took out MyBox stuff (don't need to be trying to explain stuff I don't understand to Momma; no need for her to see little boxes popping up and suggesting questions she should ask me), and I changed the value to "1" from the "0" that you'd had down. (I know that was a typo; even I spotted that.) I also had to take out that ''Option Explicit'' line. For some reason it was generating scripting errors for me. I read the error box; counted down the lines and across the characters, and just decided to take out the line. Works fine now, apparently consistently.

Entire working script is as follows:

Set WshShell = WScript.CreateObject("Wscript.Shell")

WshShell.RegWrite "HKCU\Identities\Last Username", "Momma"
WshShell.RegWrite "HKCU\Identities\Last User ID", "{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Default User ID", "{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Start As", "{584094C3-8546-49AC-AB6D-04C2A776AF0D}"

Dim WSHShell, n, p, itemtype
p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\GlobalUserOffline"
itemtype = "REG_DWORD"
n = 1

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite p, n, itemtype

WSHShell.Run "d:\batch\winxp\forms\eml-form.eml"

Thanks again m'lady. The help is appreciated.

Kelly said:
Hi Lee,

Here is one way:

Option Explicit

Dim WSHShell, n, p, itemtype, MyBox
p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline"
itemtype = "REG_DWORD"
n = 0

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite p, n, itemtype

MyBox = MsgBox("User is now Offline" , 4096)

Here is another:

Set WSHShell = WScript.CreateObject("WScript.Shell")

P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
WshShell.RegWrite p1 & "GlobalUserOffline", 1, "REG_DWORD"

--
All the Best,
Kelly

MS-MVP Win98/XP
[AE-Windows® XP]

Troubleshooting Windows XP
http://www.kellys-korner-xp.com

Top 10 Frequently Asked Questions and Answers
http://www.kellys-korner-xp.com/top10faqs.htm


I'm going to go set up a new e-mail program for my mother here next weekend
on my little brother's computer, not the one coming, but the one after, so I
have time to practice on this and get it right perhaps. (It's a couple
hundred miles, so I want to have the trick down pat when I get there).

Notion is to get her arranged so's she can draft her e-mails offline so's
she doesn't lose them into the ether as has been happening with the web mail
my little brother set up for her. A Hotmail account and an OE identity
seems to be a promising way to handle this, but I'll need for OE to come up
in offline mode even after little brother has been browsing in the interim.
Doesn't seem to be too hard a trick. I have an old vbs script I got from, I
think, MVP Doug Knox's site that I've edited selectively, and it'll set for
my Mother's identity and then open an .EML file preset to a type style
amenable to her older eyes. The only thing is I don't know anything about
vbs scripting, and am stuck on a point I haven't been able to figure out by
the trial and error method.

The script as edited goes like this:

Set WshShell = WScript.CreateObject("Wscript.Shell")

'Clear the values from the registry
WshShell.RegWrite "HKCU\Identities\Last Username", "Momma"
WshShell.RegWrite "HKCU\Identities\Last User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Default User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Start As",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"

[hereabouts is where I get lost]

WSHShell.Run "d:\winxp\forms\eml-form.eml"

Into the part where I get lost I need to insert something to get OE to start
offline even though little brother may have set it for online during the
meantime. I have found the key that controls this to be:

HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline

And I've figured out that switching the value back and forth from 0 to 1
causes OE (and I presume IE also) to load up either offline or online

However at this point I'm out of my depth. I have yet to even figure out
what exactly a DWord is in the first place, nor have I been able to stumble
across the command line for the vbs script that will cause it to switch to
offline mode before it loads up that eml-form.eml file.

Can somebody enlighten me as to how to change that DWord value to 1 via a
vbs script?
 
K

Kelly

Most welcome, Lee. Glad to help. And I know, I "still" owe you that Cajun
write-up thing. :blush:(

As for the latter, it should read as follows (and yes you need to uncheck
word wrap under Edit in notepad and Save so there is no space/line break
between P1= ).

Option Explicit

Set WSHShell = WScript.CreateObject("WScript.Shell")
Dim WSHShell, p1

P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
WshShell.RegWrite p1 & "GlobalUserOffline", 1, "REG_DWORD"

/top10faqs.htm


Thanks darlin',

I haven't been able to get the second option to work yet (seemed to get it
to work once, but then not again when I reset OE to online and tried it
again--don't know if I mistook what happened the first time or what exactly
is going on there--may tinker with it some more later and see if I can
understand why it's not working for me). That "another", second way appears
to my uneducated eye to be a way to create a key that previously didn't
exist, but I'm sure I'll figure it out better if I tinker 'round with it
some more. Possible I'm getting a word wrap in the text you provided that
I'm not finding yet.

However, the "one way", with a few WAGs at it, is working for me. I took
out MyBox stuff (don't need to be trying to explain stuff I don't understand
to Momma; no need for her to see little boxes popping up and suggesting
questions she should ask me), and I changed the value to "1" from the "0"
that you'd had down. (I know that was a typo; even I spotted that.) I also
had to take out that ''Option Explicit'' line. For some reason it was
generating scripting errors for me. I read the error box; counted down the
lines and across the characters, and just decided to take out the line.
Works fine now, apparently consistently.

Entire working script is as follows:

Set WshShell = WScript.CreateObject("Wscript.Shell")

WshShell.RegWrite "HKCU\Identities\Last Username", "Momma"
WshShell.RegWrite "HKCU\Identities\Last User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Default User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Start As",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"

Dim WSHShell, n, p, itemtype
p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline"
itemtype = "REG_DWORD"
n = 1

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite p, n, itemtype

WSHShell.Run "d:\batch\winxp\forms\eml-form.eml"

Thanks again m'lady. The help is appreciated.

Kelly said:
Hi Lee,

Here is one way:

Option Explicit

Dim WSHShell, n, p, itemtype, MyBox
p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline"
itemtype = "REG_DWORD"
n = 0

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite p, n, itemtype

MyBox = MsgBox("User is now Offline" , 4096)

Here is another:

Set WSHShell = WScript.CreateObject("WScript.Shell")

P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
WshShell.RegWrite p1 & "GlobalUserOffline", 1, "REG_DWORD"

/top10faqs.htm


I'm going to go set up a new e-mail program for my mother here next weekend
on my little brother's computer, not the one coming, but the one after, so I
have time to practice on this and get it right perhaps. (It's a couple
hundred miles, so I want to have the trick down pat when I get there).

Notion is to get her arranged so's she can draft her e-mails offline so's
she doesn't lose them into the ether as has been happening with the web mail
my little brother set up for her. A Hotmail account and an OE identity
seems to be a promising way to handle this, but I'll need for OE to come up
in offline mode even after little brother has been browsing in the interim.
Doesn't seem to be too hard a trick. I have an old vbs script I got from, I
think, MVP Doug Knox's site that I've edited selectively, and it'll set for
my Mother's identity and then open an .EML file preset to a type style
amenable to her older eyes. The only thing is I don't know anything about
vbs scripting, and am stuck on a point I haven't been able to figure out by
the trial and error method.

The script as edited goes like this:

Set WshShell = WScript.CreateObject("Wscript.Shell")

'Clear the values from the registry
WshShell.RegWrite "HKCU\Identities\Last Username", "Momma"
WshShell.RegWrite "HKCU\Identities\Last User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Default User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Start As",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"

[hereabouts is where I get lost]

WSHShell.Run "d:\winxp\forms\eml-form.eml"

Into the part where I get lost I need to insert something to get OE to start
offline even though little brother may have set it for online during the
meantime. I have found the key that controls this to be:

HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline

And I've figured out that switching the value back and forth from 0 to 1
causes OE (and I presume IE also) to load up either offline or online

However at this point I'm out of my depth. I have yet to even figure out
what exactly a DWord is in the first place, nor have I been able to stumble
across the command line for the vbs script that will cause it to switch to
offline mode before it loads up that eml-form.eml file.

Can somebody enlighten me as to how to change that DWord value to 1 via a
vbs script?
 
L

Lee C.

Kelly said:
Most welcome, Lee. Glad to help. And I know, I "still" owe you that Cajun
write-up thing. :blush:(

Not to frown; I've gotten by remarkably well without that explanation.
As for the latter, it should read as follows (and yes you need to uncheck
word wrap under Edit in notepad and Save so there is no space/line break
between P1= ).

The word wrap turned out not to be it. (I've got 3 versions of Notepad.exe under the other names of Listpad and Textpad, with different default characteristics so's I don't have to mess around with that word wrap problem. Got tired of Notepad defaulting to the .txt files filter, and got tired of setting and changing the wordwrap. But, I thought maybe OE had done a wrap on me that I hadn't found--seems they might have fixed that sometime here lately and I didn't notice--but, I digress...) I went into the registry and started manually switching back and forth that DWord value at HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explore from 1 to 0 and it seems to be making no difference at all even when altered manually. So, I'm figuring whatever the holdup is there, it's not in the scripting you provided me.

I'll look over your expanded explanation here and see if I can figure a different notion, but I'm figuring it's not the scripting..
Option Explicit

Set WSHShell = WScript.CreateObject("WScript.Shell")
Dim WSHShell, p1

P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
WshShell.RegWrite p1 & "GlobalUserOffline", 1, "REG_DWORD"

--
All the Best,
Kelly

MS-MVP Win98/XP
[AE-Windows® XP]

Troubleshooting Windows XP
http://www.kellys-korner-xp.com

Top 10 Frequently Asked Questions and Answers
http://www.kellys-korner-xp.com/top10faqs.htm


Thanks darlin',

I haven't been able to get the second option to work yet (seemed to get it
to work once, but then not again when I reset OE to online and tried it
again--don't know if I mistook what happened the first time or what exactly
is going on there--may tinker with it some more later and see if I can
understand why it's not working for me). That "another", second way appears
to my uneducated eye to be a way to create a key that previously didn't
exist, but I'm sure I'll figure it out better if I tinker 'round with it
some more. Possible I'm getting a word wrap in the text you provided that
I'm not finding yet.

However, the "one way", with a few WAGs at it, is working for me. I took
out MyBox stuff (don't need to be trying to explain stuff I don't understand
to Momma; no need for her to see little boxes popping up and suggesting
questions she should ask me), and I changed the value to "1" from the "0"
that you'd had down. (I know that was a typo; even I spotted that.) I also
had to take out that ''Option Explicit'' line. For some reason it was
generating scripting errors for me. I read the error box; counted down the
lines and across the characters, and just decided to take out the line.
Works fine now, apparently consistently.

Entire working script is as follows:

Set WshShell = WScript.CreateObject("Wscript.Shell")

WshShell.RegWrite "HKCU\Identities\Last Username", "Momma"
WshShell.RegWrite "HKCU\Identities\Last User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Default User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Start As",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"

Dim WSHShell, n, p, itemtype
p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline"
itemtype = "REG_DWORD"
n = 1

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite p, n, itemtype

WSHShell.Run "d:\batch\winxp\forms\eml-form.eml"

Thanks again m'lady. The help is appreciated.

Kelly said:
Hi Lee,

Here is one way:

Option Explicit

Dim WSHShell, n, p, itemtype, MyBox
p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline"
itemtype = "REG_DWORD"
n = 0

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite p, n, itemtype

MyBox = MsgBox("User is now Offline" , 4096)

Here is another:

Set WSHShell = WScript.CreateObject("WScript.Shell")

P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
WshShell.RegWrite p1 & "GlobalUserOffline", 1, "REG_DWORD"

--
All the Best,
Kelly

MS-MVP Win98/XP
[AE-Windows® XP]

Troubleshooting Windows XP
http://www.kellys-korner-xp.com

Top 10 Frequently Asked Questions and Answers
http://www.kellys-korner-xp.com/top10faqs.htm


I'm going to go set up a new e-mail program for my mother here next weekend
on my little brother's computer, not the one coming, but the one after, so I
have time to practice on this and get it right perhaps. (It's a couple
hundred miles, so I want to have the trick down pat when I get there).

Notion is to get her arranged so's she can draft her e-mails offline so's
she doesn't lose them into the ether as has been happening with the web mail
my little brother set up for her. A Hotmail account and an OE identity
seems to be a promising way to handle this, but I'll need for OE to come up
in offline mode even after little brother has been browsing in the interim.
Doesn't seem to be too hard a trick. I have an old vbs script I got from, I
think, MVP Doug Knox's site that I've edited selectively, and it'll set for
my Mother's identity and then open an .EML file preset to a type style
amenable to her older eyes. The only thing is I don't know anything about
vbs scripting, and am stuck on a point I haven't been able to figure out by
the trial and error method.

The script as edited goes like this:

Set WshShell = WScript.CreateObject("Wscript.Shell")

'Clear the values from the registry
WshShell.RegWrite "HKCU\Identities\Last Username", "Momma"
WshShell.RegWrite "HKCU\Identities\Last User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Default User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Start As",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"

[hereabouts is where I get lost]

WSHShell.Run "d:\winxp\forms\eml-form.eml"

Into the part where I get lost I need to insert something to get OE to start
offline even though little brother may have set it for online during the
meantime. I have found the key that controls this to be:

HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline

And I've figured out that switching the value back and forth from 0 to 1
causes OE (and I presume IE also) to load up either offline or online

However at this point I'm out of my depth. I have yet to even figure out
what exactly a DWord is in the first place, nor have I been able to stumble
across the command line for the vbs script that will cause it to switch to
offline mode before it loads up that eml-form.eml file.

Can somebody enlighten me as to how to change that DWord value to 1 via a
vbs script?
 
K

Kelly

Not to frown; I've gotten by remarkably well without that explanation.

LOL! and Good luck on the rest, Lee. :blush:)

/top10faqs.htm


Kelly said:
Most welcome, Lee. Glad to help. And I know, I "still" owe you that Cajun
write-up thing. :blush:(

Not to frown; I've gotten by remarkably well without that explanation.
As for the latter, it should read as follows (and yes you need to uncheck
word wrap under Edit in notepad and Save so there is no space/line break
between P1= ).

The word wrap turned out not to be it. (I've got 3 versions of Notepad.exe
under the other names of Listpad and Textpad, with different default
characteristics so's I don't have to mess around with that word wrap
problem. Got tired of Notepad defaulting to the .txt files filter, and got
tired of setting and changing the wordwrap. But, I thought maybe OE had
done a wrap on me that I hadn't found--seems they might have fixed that
sometime here lately and I didn't notice--but, I digress...) I went into
the registry and started manually switching back and forth that DWord value
at HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explore from 1 to
0 and it seems to be making no difference at all even when altered manually.
So, I'm figuring whatever the holdup is there, it's not in the scripting you
provided me.

I'll look over your expanded explanation here and see if I can figure a
different notion, but I'm figuring it's not the scripting..
Option Explicit

Set WSHShell = WScript.CreateObject("WScript.Shell")
Dim WSHShell, p1

P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
WshShell.RegWrite p1 & "GlobalUserOffline", 1, "REG_DWORD"

/top10faqs.htm


Thanks darlin',

I haven't been able to get the second option to work yet (seemed to get it
to work once, but then not again when I reset OE to online and tried it
again--don't know if I mistook what happened the first time or what exactly
is going on there--may tinker with it some more later and see if I can
understand why it's not working for me). That "another", second way appears
to my uneducated eye to be a way to create a key that previously didn't
exist, but I'm sure I'll figure it out better if I tinker 'round with it
some more. Possible I'm getting a word wrap in the text you provided that
I'm not finding yet.

However, the "one way", with a few WAGs at it, is working for me. I took
out MyBox stuff (don't need to be trying to explain stuff I don't understand
to Momma; no need for her to see little boxes popping up and suggesting
questions she should ask me), and I changed the value to "1" from the "0"
that you'd had down. (I know that was a typo; even I spotted that.) I also
had to take out that ''Option Explicit'' line. For some reason it was
generating scripting errors for me. I read the error box; counted down the
lines and across the characters, and just decided to take out the line.
Works fine now, apparently consistently.

Entire working script is as follows:

Set WshShell = WScript.CreateObject("Wscript.Shell")

WshShell.RegWrite "HKCU\Identities\Last Username", "Momma"
WshShell.RegWrite "HKCU\Identities\Last User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Default User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Start As",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"

Dim WSHShell, n, p, itemtype
p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline"
itemtype = "REG_DWORD"
n = 1

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite p, n, itemtype

WSHShell.Run "d:\batch\winxp\forms\eml-form.eml"

Thanks again m'lady. The help is appreciated.

Kelly said:
Hi Lee,

Here is one way:

Option Explicit

Dim WSHShell, n, p, itemtype, MyBox
p = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline"
itemtype = "REG_DWORD"
n = 0

Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite p, n, itemtype

MyBox = MsgBox("User is now Offline" , 4096)

Here is another:

Set WSHShell = WScript.CreateObject("WScript.Shell")

P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
WshShell.RegWrite p1 & "GlobalUserOffline", 1, "REG_DWORD"

/top10faqs.htm


I'm going to go set up a new e-mail program for my mother here next weekend
on my little brother's computer, not the one coming, but the one after,
so
I
have time to practice on this and get it right perhaps. (It's a couple
hundred miles, so I want to have the trick down pat when I get there).

Notion is to get her arranged so's she can draft her e-mails offline so's
she doesn't lose them into the ether as has been happening with the web mail
my little brother set up for her. A Hotmail account and an OE identity
seems to be a promising way to handle this, but I'll need for OE to come up
in offline mode even after little brother has been browsing in the interim.
Doesn't seem to be too hard a trick. I have an old vbs script I got
from,
I
think, MVP Doug Knox's site that I've edited selectively, and it'll set for
my Mother's identity and then open an .EML file preset to a type style
amenable to her older eyes. The only thing is I don't know anything about
vbs scripting, and am stuck on a point I haven't been able to figure out by
the trial and error method.

The script as edited goes like this:

Set WshShell = WScript.CreateObject("Wscript.Shell")

'Clear the values from the registry
WshShell.RegWrite "HKCU\Identities\Last Username", "Momma"
WshShell.RegWrite "HKCU\Identities\Last User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Default User ID",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"
WshShell.RegWrite "HKCU\Identities\Start As",
"{584094C3-8546-49AC-AB6D-04C2A776AF0D}"

[hereabouts is where I get lost]

WSHShell.Run "d:\winxp\forms\eml-form.eml"

Into the part where I get lost I need to insert something to get OE to start
offline even though little brother may have set it for online during the
meantime. I have found the key that controls this to be:

HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline

And I've figured out that switching the value back and forth from 0 to 1
causes OE (and I presume IE also) to load up either offline or online

However at this point I'm out of my depth. I have yet to even figure out
what exactly a DWord is in the first place, nor have I been able to stumble
across the command line for the vbs script that will cause it to switch to
offline mode before it loads up that eml-form.eml file.

Can somebody enlighten me as to how to change that DWord value to 1 via a
vbs script?
 
L

Lee C.

Kelly said:
... and Good luck on the rest, Lee.

You have done contributed to creation of a monster. I've figured out (I think) why the one option wasn't working for me, a little tinker I threw into my registry way back. And I've gotten the vbs working quite nicely, then thrown in a few embellishments and gotten them working, and have been looking at my .bat files, wondering which of them ought to be pitched in favor of .vbs files and where I can find directions on how to write them and what the jargon and syntax consists of. This is not good.
 
K

Kelly

You have done contributed to creation of a monster.

Oh-boy! And that is not necessarily a bad thing, either. :blush:) Scripts can
be fun. And some don't really need to go that far. Reg files work just as
well in many cases.

Am betting there are plenty sources out there, I haven't ever used one so I
can't really recommend any in particular. Am self taught by example and of
course with a little help from my friends (Doug Knox and Bill James). :blush:)

If you are needing any help, write me, I'd be glad to help if I can, Lee.

/top10faqs.htm


Kelly said:
... and Good luck on the rest, Lee.

You have done contributed to creation of a monster. I've figured out (I
think) why the one option wasn't working for me, a little tinker I threw
into my registry way back. And I've gotten the vbs working quite nicely,
then thrown in a few embellishments and gotten them working, and have been
looking at my .bat files, wondering which of them ought to be pitched in
favor of .vbs files and where I can find directions on how to write them and
what the jargon and syntax consists of. This is not good.
 
L

Lee C.

Kelly said:
Am self taught by example and of
course with a little help from my friends (Doug Knox and Bill James).

If you are needing any help, write me, I'd be glad to help if I can, Lee.

Well, I've never had any formal computer education either--started with the instruction books assembly of boxed machine for DOS 5.0, and picture shows keyboard plugs in "here", (don't seem to have enough prongs for 82 keys does it?), and next, the monitor plugs in here, and ...

Winter is coming; work always slows down in the winter. You may have reason to regret having offered to help with vbs learnin'. I have your e-mail address.

'Til later darlin...
 
K

Kelly

Nah, won't have any regrets at all, Lee! We go back a great ways.....

/top10faqs.htm


Kelly said:
Am self taught by example and of
course with a little help from my friends (Doug Knox and Bill James).

If you are needing any help, write me, I'd be glad to help if I can, Lee.

Well, I've never had any formal computer education either--started with the
instruction books assembly of boxed machine for DOS 5.0, and picture shows
keyboard plugs in "here", (don't seem to have enough prongs for 82 keys does
it?), and next, the monitor plugs in here, and ...

Winter is coming; work always slows down in the winter. You may have reason
to regret having offered to help with vbs learnin'. I have your e-mail
address.

'Til later darlin...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top