OT: Script question, Doug?
#31
Guest
Posts: n/a
Re: Script question, Doug?
Almost forgot, thank you very much for the help thus far!
Carl
"DougW" <I.only.read.usenet@invalid.address> wrote in message
news:VsGFi.64056$xZ2.21974@newsfe10.phx...
> Ugly, but it works.
> mind the wraps.
>
> What it does.
> 1) checks to see if the key is there, if not it creates it.
> You need to have this first key the same as one of your rolling changes
> or it won't work properly.
> 2) Pulls the key and does a case statement to see what to change it to.
> 3) writes that to the registry.
>
> I used a function to clean up the code a bit.
>
> Next would be to use an array and some better error checking
> to make sure things didn't get lost and to make it easier to
> add titles. You could even pull them from a file and use a
> registry key to index the file for next time. :)
>
> Happy scripting.
>
> ----------------------------
>
> Dim objShell, Title
> Set objShell = WScript.CreateObject("WScript.Shell")
> On Error resume next
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet Explorer\Main\Window Title")
> If err <> 0 then
> Title = "TITLE1"
> RewriteTitle(Title)
> End If
> Select Case Title
> Case "TITLE1"
> RewriteTitle ("TITLE2")
> Case "TITLE2"
> RewriteTitle ("TITLE3")
> Case "TITLE3"
> RewriteTitle ("TITLE1")
> End Select
>
> Function RewriteTitle(foostring)
> objShell.RegWrite _
> "HKCU\Software\Microsoft\Internet Explorer\Main\Window Title",
> foostring, "REG_SZ"
> end Function
>
> --------------------------------
>
>
Carl
"DougW" <I.only.read.usenet@invalid.address> wrote in message
news:VsGFi.64056$xZ2.21974@newsfe10.phx...
> Ugly, but it works.
> mind the wraps.
>
> What it does.
> 1) checks to see if the key is there, if not it creates it.
> You need to have this first key the same as one of your rolling changes
> or it won't work properly.
> 2) Pulls the key and does a case statement to see what to change it to.
> 3) writes that to the registry.
>
> I used a function to clean up the code a bit.
>
> Next would be to use an array and some better error checking
> to make sure things didn't get lost and to make it easier to
> add titles. You could even pull them from a file and use a
> registry key to index the file for next time. :)
>
> Happy scripting.
>
> ----------------------------
>
> Dim objShell, Title
> Set objShell = WScript.CreateObject("WScript.Shell")
> On Error resume next
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet Explorer\Main\Window Title")
> If err <> 0 then
> Title = "TITLE1"
> RewriteTitle(Title)
> End If
> Select Case Title
> Case "TITLE1"
> RewriteTitle ("TITLE2")
> Case "TITLE2"
> RewriteTitle ("TITLE3")
> Case "TITLE3"
> RewriteTitle ("TITLE1")
> End Select
>
> Function RewriteTitle(foostring)
> objShell.RegWrite _
> "HKCU\Software\Microsoft\Internet Explorer\Main\Window Title",
> foostring, "REG_SZ"
> end Function
>
> --------------------------------
>
>
#32
Guest
Posts: n/a
Re: Script question, Doug?
Almost forgot, thank you very much for the help thus far!
Carl
"DougW" <I.only.read.usenet@invalid.address> wrote in message
news:VsGFi.64056$xZ2.21974@newsfe10.phx...
> Ugly, but it works.
> mind the wraps.
>
> What it does.
> 1) checks to see if the key is there, if not it creates it.
> You need to have this first key the same as one of your rolling changes
> or it won't work properly.
> 2) Pulls the key and does a case statement to see what to change it to.
> 3) writes that to the registry.
>
> I used a function to clean up the code a bit.
>
> Next would be to use an array and some better error checking
> to make sure things didn't get lost and to make it easier to
> add titles. You could even pull them from a file and use a
> registry key to index the file for next time. :)
>
> Happy scripting.
>
> ----------------------------
>
> Dim objShell, Title
> Set objShell = WScript.CreateObject("WScript.Shell")
> On Error resume next
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet Explorer\Main\Window Title")
> If err <> 0 then
> Title = "TITLE1"
> RewriteTitle(Title)
> End If
> Select Case Title
> Case "TITLE1"
> RewriteTitle ("TITLE2")
> Case "TITLE2"
> RewriteTitle ("TITLE3")
> Case "TITLE3"
> RewriteTitle ("TITLE1")
> End Select
>
> Function RewriteTitle(foostring)
> objShell.RegWrite _
> "HKCU\Software\Microsoft\Internet Explorer\Main\Window Title",
> foostring, "REG_SZ"
> end Function
>
> --------------------------------
>
>
Carl
"DougW" <I.only.read.usenet@invalid.address> wrote in message
news:VsGFi.64056$xZ2.21974@newsfe10.phx...
> Ugly, but it works.
> mind the wraps.
>
> What it does.
> 1) checks to see if the key is there, if not it creates it.
> You need to have this first key the same as one of your rolling changes
> or it won't work properly.
> 2) Pulls the key and does a case statement to see what to change it to.
> 3) writes that to the registry.
>
> I used a function to clean up the code a bit.
>
> Next would be to use an array and some better error checking
> to make sure things didn't get lost and to make it easier to
> add titles. You could even pull them from a file and use a
> registry key to index the file for next time. :)
>
> Happy scripting.
>
> ----------------------------
>
> Dim objShell, Title
> Set objShell = WScript.CreateObject("WScript.Shell")
> On Error resume next
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet Explorer\Main\Window Title")
> If err <> 0 then
> Title = "TITLE1"
> RewriteTitle(Title)
> End If
> Select Case Title
> Case "TITLE1"
> RewriteTitle ("TITLE2")
> Case "TITLE2"
> RewriteTitle ("TITLE3")
> Case "TITLE3"
> RewriteTitle ("TITLE1")
> End Select
>
> Function RewriteTitle(foostring)
> objShell.RegWrite _
> "HKCU\Software\Microsoft\Internet Explorer\Main\Window Title",
> foostring, "REG_SZ"
> end Function
>
> --------------------------------
>
>
#33
Guest
Posts: n/a
Re: Script question, Doug?
Almost forgot, thank you very much for the help thus far!
Carl
"DougW" <I.only.read.usenet@invalid.address> wrote in message
news:VsGFi.64056$xZ2.21974@newsfe10.phx...
> Ugly, but it works.
> mind the wraps.
>
> What it does.
> 1) checks to see if the key is there, if not it creates it.
> You need to have this first key the same as one of your rolling changes
> or it won't work properly.
> 2) Pulls the key and does a case statement to see what to change it to.
> 3) writes that to the registry.
>
> I used a function to clean up the code a bit.
>
> Next would be to use an array and some better error checking
> to make sure things didn't get lost and to make it easier to
> add titles. You could even pull them from a file and use a
> registry key to index the file for next time. :)
>
> Happy scripting.
>
> ----------------------------
>
> Dim objShell, Title
> Set objShell = WScript.CreateObject("WScript.Shell")
> On Error resume next
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet Explorer\Main\Window Title")
> If err <> 0 then
> Title = "TITLE1"
> RewriteTitle(Title)
> End If
> Select Case Title
> Case "TITLE1"
> RewriteTitle ("TITLE2")
> Case "TITLE2"
> RewriteTitle ("TITLE3")
> Case "TITLE3"
> RewriteTitle ("TITLE1")
> End Select
>
> Function RewriteTitle(foostring)
> objShell.RegWrite _
> "HKCU\Software\Microsoft\Internet Explorer\Main\Window Title",
> foostring, "REG_SZ"
> end Function
>
> --------------------------------
>
>
Carl
"DougW" <I.only.read.usenet@invalid.address> wrote in message
news:VsGFi.64056$xZ2.21974@newsfe10.phx...
> Ugly, but it works.
> mind the wraps.
>
> What it does.
> 1) checks to see if the key is there, if not it creates it.
> You need to have this first key the same as one of your rolling changes
> or it won't work properly.
> 2) Pulls the key and does a case statement to see what to change it to.
> 3) writes that to the registry.
>
> I used a function to clean up the code a bit.
>
> Next would be to use an array and some better error checking
> to make sure things didn't get lost and to make it easier to
> add titles. You could even pull them from a file and use a
> registry key to index the file for next time. :)
>
> Happy scripting.
>
> ----------------------------
>
> Dim objShell, Title
> Set objShell = WScript.CreateObject("WScript.Shell")
> On Error resume next
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet Explorer\Main\Window Title")
> If err <> 0 then
> Title = "TITLE1"
> RewriteTitle(Title)
> End If
> Select Case Title
> Case "TITLE1"
> RewriteTitle ("TITLE2")
> Case "TITLE2"
> RewriteTitle ("TITLE3")
> Case "TITLE3"
> RewriteTitle ("TITLE1")
> End Select
>
> Function RewriteTitle(foostring)
> objShell.RegWrite _
> "HKCU\Software\Microsoft\Internet Explorer\Main\Window Title",
> foostring, "REG_SZ"
> end Function
>
> --------------------------------
>
>
#38
Guest
Posts: n/a
Re: Script question, Doug?
DougW wrote:
> Carl S wrote:
>> Doug,
>>
>> I must not have something installed on my PC because it doesnt
>> seem to work for me, even if I copy and paste your code directly.
>
> It's not a .bat (batch file), save it as a .vbs file.
Heh.. forgot.
You call a .vbs from within a batch file by using
cscript //nologo <filename>.vbs
Running "cscript" in a dos window will give you all
the command lines.
--
DougW
> Carl S wrote:
>> Doug,
>>
>> I must not have something installed on my PC because it doesnt
>> seem to work for me, even if I copy and paste your code directly.
>
> It's not a .bat (batch file), save it as a .vbs file.
Heh.. forgot.
You call a .vbs from within a batch file by using
cscript //nologo <filename>.vbs
Running "cscript" in a dos window will give you all
the command lines.
--
DougW
#39
Guest
Posts: n/a
Re: Script question, Doug?
DougW wrote:
> Carl S wrote:
>> Doug,
>>
>> I must not have something installed on my PC because it doesnt
>> seem to work for me, even if I copy and paste your code directly.
>
> It's not a .bat (batch file), save it as a .vbs file.
Heh.. forgot.
You call a .vbs from within a batch file by using
cscript //nologo <filename>.vbs
Running "cscript" in a dos window will give you all
the command lines.
--
DougW
> Carl S wrote:
>> Doug,
>>
>> I must not have something installed on my PC because it doesnt
>> seem to work for me, even if I copy and paste your code directly.
>
> It's not a .bat (batch file), save it as a .vbs file.
Heh.. forgot.
You call a .vbs from within a batch file by using
cscript //nologo <filename>.vbs
Running "cscript" in a dos window will give you all
the command lines.
--
DougW
#40
Guest
Posts: n/a
Re: Script question, Doug?
DougW wrote:
> Carl S wrote:
>> Doug,
>>
>> I must not have something installed on my PC because it doesnt
>> seem to work for me, even if I copy and paste your code directly.
>
> It's not a .bat (batch file), save it as a .vbs file.
Heh.. forgot.
You call a .vbs from within a batch file by using
cscript //nologo <filename>.vbs
Running "cscript" in a dos window will give you all
the command lines.
--
DougW
> Carl S wrote:
>> Doug,
>>
>> I must not have something installed on my PC because it doesnt
>> seem to work for me, even if I copy and paste your code directly.
>
> It's not a .bat (batch file), save it as a .vbs file.
Heh.. forgot.
You call a .vbs from within a batch file by using
cscript //nologo <filename>.vbs
Running "cscript" in a dos window will give you all
the command lines.
--
DougW