Jeeps Canada - Jeep Forums

Jeeps Canada - Jeep Forums (https://www.jeepscanada.com/)
-   Jeep Mailing List (https://www.jeepscanada.com/jeep-mailing-list-32/)
-   -   OT: Script question, Doug? (https://www.jeepscanada.com/jeep-mailing-list-32/ot-script-question-doug-48553/)

Carl S 09-11-2007 12:02 AM

OT: Script question, Doug?
 
Doug,

I need to write a script to modify a registry entry of a given key with
one of 3 values I will provide. The order it selects the new values isn't
important, so long as it selects a different value each time. This can be a
..exe or .bat, as I will be dropping it into the windows startup. It doesn't
need to be pretty, but must require minimal user intervention.

Can this be done without a code compiler?

The last coding I did was years ago with C++.

I was thinking something like pull the existing key and load into a
variable, then compare the variable against a rule set and replace it
accordingly.

(script grabs value, assigns name 'value')

1 = "jeep"
IF value="jeep" GOTO 2

2 = "wrangler"
IF value="wrangler" GOTO 3

3 = "cherokee"
IF value="cherokee" GOTO 1

(script replaces value)

Some pointers would be great..

Carl



Carl S 09-11-2007 01:09 AM

Re: Script question, Doug?
 
Doug,

Here's what I've got so far.

Set objShell = WScript.CreateObject("WScript.Shell")
Title = objShell.RegRead _
("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")

If Title = "Carl2" Then
Wscript.regwrite "carl3"
Else
Wscript.regwrite "carl7"
End If

The problem is that no matter what combinaton I use to enter my path, it
says not found...

Carl


"Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
> Doug,
>
> I need to write a script to modify a registry entry of a given key with
> one of 3 values I will provide. The order it selects the new values isn't
> important, so long as it selects a different value each time. This can be
> a .exe or .bat, as I will be dropping it into the windows startup. It
> doesn't need to be pretty, but must require minimal user intervention.
>
> Can this be done without a code compiler?
>
> The last coding I did was years ago with C++.
>
> I was thinking something like pull the existing key and load into a
> variable, then compare the variable against a rule set and replace it
> accordingly.
>
> (script grabs value, assigns name 'value')
>
> 1 = "jeep"
> IF value="jeep" GOTO 2
>
> 2 = "wrangler"
> IF value="wrangler" GOTO 3
>
> 3 = "cherokee"
> IF value="cherokee" GOTO 1
>
> (script replaces value)
>
> Some pointers would be great..
>
> Carl
>




Carl S 09-11-2007 01:09 AM

Re: Script question, Doug?
 
Doug,

Here's what I've got so far.

Set objShell = WScript.CreateObject("WScript.Shell")
Title = objShell.RegRead _
("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")

If Title = "Carl2" Then
Wscript.regwrite "carl3"
Else
Wscript.regwrite "carl7"
End If

The problem is that no matter what combinaton I use to enter my path, it
says not found...

Carl


"Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
> Doug,
>
> I need to write a script to modify a registry entry of a given key with
> one of 3 values I will provide. The order it selects the new values isn't
> important, so long as it selects a different value each time. This can be
> a .exe or .bat, as I will be dropping it into the windows startup. It
> doesn't need to be pretty, but must require minimal user intervention.
>
> Can this be done without a code compiler?
>
> The last coding I did was years ago with C++.
>
> I was thinking something like pull the existing key and load into a
> variable, then compare the variable against a rule set and replace it
> accordingly.
>
> (script grabs value, assigns name 'value')
>
> 1 = "jeep"
> IF value="jeep" GOTO 2
>
> 2 = "wrangler"
> IF value="wrangler" GOTO 3
>
> 3 = "cherokee"
> IF value="cherokee" GOTO 1
>
> (script replaces value)
>
> Some pointers would be great..
>
> Carl
>




Carl S 09-11-2007 01:09 AM

Re: Script question, Doug?
 
Doug,

Here's what I've got so far.

Set objShell = WScript.CreateObject("WScript.Shell")
Title = objShell.RegRead _
("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")

If Title = "Carl2" Then
Wscript.regwrite "carl3"
Else
Wscript.regwrite "carl7"
End If

The problem is that no matter what combinaton I use to enter my path, it
says not found...

Carl


"Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
> Doug,
>
> I need to write a script to modify a registry entry of a given key with
> one of 3 values I will provide. The order it selects the new values isn't
> important, so long as it selects a different value each time. This can be
> a .exe or .bat, as I will be dropping it into the windows startup. It
> doesn't need to be pretty, but must require minimal user intervention.
>
> Can this be done without a code compiler?
>
> The last coding I did was years ago with C++.
>
> I was thinking something like pull the existing key and load into a
> variable, then compare the variable against a rule set and replace it
> accordingly.
>
> (script grabs value, assigns name 'value')
>
> 1 = "jeep"
> IF value="jeep" GOTO 2
>
> 2 = "wrangler"
> IF value="wrangler" GOTO 3
>
> 3 = "cherokee"
> IF value="cherokee" GOTO 1
>
> (script replaces value)
>
> Some pointers would be great..
>
> Carl
>




Carl S 09-11-2007 01:09 AM

Re: Script question, Doug?
 
Doug,

Here's what I've got so far.

Set objShell = WScript.CreateObject("WScript.Shell")
Title = objShell.RegRead _
("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")

If Title = "Carl2" Then
Wscript.regwrite "carl3"
Else
Wscript.regwrite "carl7"
End If

The problem is that no matter what combinaton I use to enter my path, it
says not found...

Carl


"Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
> Doug,
>
> I need to write a script to modify a registry entry of a given key with
> one of 3 values I will provide. The order it selects the new values isn't
> important, so long as it selects a different value each time. This can be
> a .exe or .bat, as I will be dropping it into the windows startup. It
> doesn't need to be pretty, but must require minimal user intervention.
>
> Can this be done without a code compiler?
>
> The last coding I did was years ago with C++.
>
> I was thinking something like pull the existing key and load into a
> variable, then compare the variable against a rule set and replace it
> accordingly.
>
> (script grabs value, assigns name 'value')
>
> 1 = "jeep"
> IF value="jeep" GOTO 2
>
> 2 = "wrangler"
> IF value="wrangler" GOTO 3
>
> 3 = "cherokee"
> IF value="cherokee" GOTO 1
>
> (script replaces value)
>
> Some pointers would be great..
>
> Carl
>




Carl S 09-11-2007 01:10 AM

Re: Script question, Doug?
 
Err window title is the string name but i made another one called 'window'
for testing.

"Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
news:KbednVqQrp2xvnvbnZ2dnUVZ_tuonZ2d@comcast.com. ..
> Doug,
>
> Here's what I've got so far.
>
> Set objShell = WScript.CreateObject("WScript.Shell")
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>
> If Title = "Carl2" Then
> Wscript.regwrite "carl3"
> Else
> Wscript.regwrite "carl7"
> End If
>
> The problem is that no matter what combinaton I use to enter my path, it
> says not found...
>
> Carl
>
>
> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>> Doug,
>>
>> I need to write a script to modify a registry entry of a given key
>> with one of 3 values I will provide. The order it selects the new values
>> isn't important, so long as it selects a different value each time. This
>> can be a .exe or .bat, as I will be dropping it into the windows startup.
>> It doesn't need to be pretty, but must require minimal user intervention.
>>
>> Can this be done without a code compiler?
>>
>> The last coding I did was years ago with C++.
>>
>> I was thinking something like pull the existing key and load into a
>> variable, then compare the variable against a rule set and replace it
>> accordingly.
>>
>> (script grabs value, assigns name 'value')
>>
>> 1 = "jeep"
>> IF value="jeep" GOTO 2
>>
>> 2 = "wrangler"
>> IF value="wrangler" GOTO 3
>>
>> 3 = "cherokee"
>> IF value="cherokee" GOTO 1
>>
>> (script replaces value)
>>
>> Some pointers would be great..
>>
>> Carl
>>

>
>




Carl S 09-11-2007 01:10 AM

Re: Script question, Doug?
 
Err window title is the string name but i made another one called 'window'
for testing.

"Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
news:KbednVqQrp2xvnvbnZ2dnUVZ_tuonZ2d@comcast.com. ..
> Doug,
>
> Here's what I've got so far.
>
> Set objShell = WScript.CreateObject("WScript.Shell")
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>
> If Title = "Carl2" Then
> Wscript.regwrite "carl3"
> Else
> Wscript.regwrite "carl7"
> End If
>
> The problem is that no matter what combinaton I use to enter my path, it
> says not found...
>
> Carl
>
>
> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>> Doug,
>>
>> I need to write a script to modify a registry entry of a given key
>> with one of 3 values I will provide. The order it selects the new values
>> isn't important, so long as it selects a different value each time. This
>> can be a .exe or .bat, as I will be dropping it into the windows startup.
>> It doesn't need to be pretty, but must require minimal user intervention.
>>
>> Can this be done without a code compiler?
>>
>> The last coding I did was years ago with C++.
>>
>> I was thinking something like pull the existing key and load into a
>> variable, then compare the variable against a rule set and replace it
>> accordingly.
>>
>> (script grabs value, assigns name 'value')
>>
>> 1 = "jeep"
>> IF value="jeep" GOTO 2
>>
>> 2 = "wrangler"
>> IF value="wrangler" GOTO 3
>>
>> 3 = "cherokee"
>> IF value="cherokee" GOTO 1
>>
>> (script replaces value)
>>
>> Some pointers would be great..
>>
>> Carl
>>

>
>




Carl S 09-11-2007 01:10 AM

Re: Script question, Doug?
 
Err window title is the string name but i made another one called 'window'
for testing.

"Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
news:KbednVqQrp2xvnvbnZ2dnUVZ_tuonZ2d@comcast.com. ..
> Doug,
>
> Here's what I've got so far.
>
> Set objShell = WScript.CreateObject("WScript.Shell")
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>
> If Title = "Carl2" Then
> Wscript.regwrite "carl3"
> Else
> Wscript.regwrite "carl7"
> End If
>
> The problem is that no matter what combinaton I use to enter my path, it
> says not found...
>
> Carl
>
>
> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>> Doug,
>>
>> I need to write a script to modify a registry entry of a given key
>> with one of 3 values I will provide. The order it selects the new values
>> isn't important, so long as it selects a different value each time. This
>> can be a .exe or .bat, as I will be dropping it into the windows startup.
>> It doesn't need to be pretty, but must require minimal user intervention.
>>
>> Can this be done without a code compiler?
>>
>> The last coding I did was years ago with C++.
>>
>> I was thinking something like pull the existing key and load into a
>> variable, then compare the variable against a rule set and replace it
>> accordingly.
>>
>> (script grabs value, assigns name 'value')
>>
>> 1 = "jeep"
>> IF value="jeep" GOTO 2
>>
>> 2 = "wrangler"
>> IF value="wrangler" GOTO 3
>>
>> 3 = "cherokee"
>> IF value="cherokee" GOTO 1
>>
>> (script replaces value)
>>
>> Some pointers would be great..
>>
>> Carl
>>

>
>




Carl S 09-11-2007 01:10 AM

Re: Script question, Doug?
 
Err window title is the string name but i made another one called 'window'
for testing.

"Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
news:KbednVqQrp2xvnvbnZ2dnUVZ_tuonZ2d@comcast.com. ..
> Doug,
>
> Here's what I've got so far.
>
> Set objShell = WScript.CreateObject("WScript.Shell")
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>
> If Title = "Carl2" Then
> Wscript.regwrite "carl3"
> Else
> Wscript.regwrite "carl7"
> End If
>
> The problem is that no matter what combinaton I use to enter my path, it
> says not found...
>
> Carl
>
>
> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>> Doug,
>>
>> I need to write a script to modify a registry entry of a given key
>> with one of 3 values I will provide. The order it selects the new values
>> isn't important, so long as it selects a different value each time. This
>> can be a .exe or .bat, as I will be dropping it into the windows startup.
>> It doesn't need to be pretty, but must require minimal user intervention.
>>
>> Can this be done without a code compiler?
>>
>> The last coding I did was years ago with C++.
>>
>> I was thinking something like pull the existing key and load into a
>> variable, then compare the variable against a rule set and replace it
>> accordingly.
>>
>> (script grabs value, assigns name 'value')
>>
>> 1 = "jeep"
>> IF value="jeep" GOTO 2
>>
>> 2 = "wrangler"
>> IF value="wrangler" GOTO 3
>>
>> 3 = "cherokee"
>> IF value="cherokee" GOTO 1
>>
>> (script replaces value)
>>
>> Some pointers would be great..
>>
>> Carl
>>

>
>




Dave Milne 09-11-2007 02:02 AM

Re: Script question, Doug?
 
I don't have that key in mine fwiw. Internet Explorer doesn't have an
underscore, and there is no Window underneath it.

Dave Milne, Scotland

Carl S wrote:
> Doug,
>
> Here's what I've got so far.
>
> Set objShell = WScript.CreateObject("WScript.Shell")
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>
> If Title = "Carl2" Then
> Wscript.regwrite "carl3"
> Else
> Wscript.regwrite "carl7"
> End If
>
> The problem is that no matter what combinaton I use to enter my path, it
> says not found...
>
> Carl
>
>
> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>> Doug,
>>
>> I need to write a script to modify a registry entry of a given key with
>> one of 3 values I will provide. The order it selects the new values isn't
>> important, so long as it selects a different value each time. This can be
>> a .exe or .bat, as I will be dropping it into the windows startup. It
>> doesn't need to be pretty, but must require minimal user intervention.
>>
>> Can this be done without a code compiler?
>>
>> The last coding I did was years ago with C++.
>>
>> I was thinking something like pull the existing key and load into a
>> variable, then compare the variable against a rule set and replace it
>> accordingly.
>>
>> (script grabs value, assigns name 'value')
>>
>> 1 = "jeep"
>> IF value="jeep" GOTO 2
>>
>> 2 = "wrangler"
>> IF value="wrangler" GOTO 3
>>
>> 3 = "cherokee"
>> IF value="cherokee" GOTO 1
>>
>> (script replaces value)
>>
>> Some pointers would be great..
>>
>> Carl
>>

>
>


Dave Milne 09-11-2007 02:02 AM

Re: Script question, Doug?
 
I don't have that key in mine fwiw. Internet Explorer doesn't have an
underscore, and there is no Window underneath it.

Dave Milne, Scotland

Carl S wrote:
> Doug,
>
> Here's what I've got so far.
>
> Set objShell = WScript.CreateObject("WScript.Shell")
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>
> If Title = "Carl2" Then
> Wscript.regwrite "carl3"
> Else
> Wscript.regwrite "carl7"
> End If
>
> The problem is that no matter what combinaton I use to enter my path, it
> says not found...
>
> Carl
>
>
> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>> Doug,
>>
>> I need to write a script to modify a registry entry of a given key with
>> one of 3 values I will provide. The order it selects the new values isn't
>> important, so long as it selects a different value each time. This can be
>> a .exe or .bat, as I will be dropping it into the windows startup. It
>> doesn't need to be pretty, but must require minimal user intervention.
>>
>> Can this be done without a code compiler?
>>
>> The last coding I did was years ago with C++.
>>
>> I was thinking something like pull the existing key and load into a
>> variable, then compare the variable against a rule set and replace it
>> accordingly.
>>
>> (script grabs value, assigns name 'value')
>>
>> 1 = "jeep"
>> IF value="jeep" GOTO 2
>>
>> 2 = "wrangler"
>> IF value="wrangler" GOTO 3
>>
>> 3 = "cherokee"
>> IF value="cherokee" GOTO 1
>>
>> (script replaces value)
>>
>> Some pointers would be great..
>>
>> Carl
>>

>
>


Dave Milne 09-11-2007 02:02 AM

Re: Script question, Doug?
 
I don't have that key in mine fwiw. Internet Explorer doesn't have an
underscore, and there is no Window underneath it.

Dave Milne, Scotland

Carl S wrote:
> Doug,
>
> Here's what I've got so far.
>
> Set objShell = WScript.CreateObject("WScript.Shell")
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>
> If Title = "Carl2" Then
> Wscript.regwrite "carl3"
> Else
> Wscript.regwrite "carl7"
> End If
>
> The problem is that no matter what combinaton I use to enter my path, it
> says not found...
>
> Carl
>
>
> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>> Doug,
>>
>> I need to write a script to modify a registry entry of a given key with
>> one of 3 values I will provide. The order it selects the new values isn't
>> important, so long as it selects a different value each time. This can be
>> a .exe or .bat, as I will be dropping it into the windows startup. It
>> doesn't need to be pretty, but must require minimal user intervention.
>>
>> Can this be done without a code compiler?
>>
>> The last coding I did was years ago with C++.
>>
>> I was thinking something like pull the existing key and load into a
>> variable, then compare the variable against a rule set and replace it
>> accordingly.
>>
>> (script grabs value, assigns name 'value')
>>
>> 1 = "jeep"
>> IF value="jeep" GOTO 2
>>
>> 2 = "wrangler"
>> IF value="wrangler" GOTO 3
>>
>> 3 = "cherokee"
>> IF value="cherokee" GOTO 1
>>
>> (script replaces value)
>>
>> Some pointers would be great..
>>
>> Carl
>>

>
>


Dave Milne 09-11-2007 02:02 AM

Re: Script question, Doug?
 
I don't have that key in mine fwiw. Internet Explorer doesn't have an
underscore, and there is no Window underneath it.

Dave Milne, Scotland

Carl S wrote:
> Doug,
>
> Here's what I've got so far.
>
> Set objShell = WScript.CreateObject("WScript.Shell")
> Title = objShell.RegRead _
> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>
> If Title = "Carl2" Then
> Wscript.regwrite "carl3"
> Else
> Wscript.regwrite "carl7"
> End If
>
> The problem is that no matter what combinaton I use to enter my path, it
> says not found...
>
> Carl
>
>
> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>> Doug,
>>
>> I need to write a script to modify a registry entry of a given key with
>> one of 3 values I will provide. The order it selects the new values isn't
>> important, so long as it selects a different value each time. This can be
>> a .exe or .bat, as I will be dropping it into the windows startup. It
>> doesn't need to be pretty, but must require minimal user intervention.
>>
>> Can this be done without a code compiler?
>>
>> The last coding I did was years ago with C++.
>>
>> I was thinking something like pull the existing key and load into a
>> variable, then compare the variable against a rule set and replace it
>> accordingly.
>>
>> (script grabs value, assigns name 'value')
>>
>> 1 = "jeep"
>> IF value="jeep" GOTO 2
>>
>> 2 = "wrangler"
>> IF value="wrangler" GOTO 3
>>
>> 3 = "cherokee"
>> IF value="cherokee" GOTO 1
>>
>> (script replaces value)
>>
>> Some pointers would be great..
>>
>> Carl
>>

>
>


Carl S 09-11-2007 02:13 AM

Re: Script question, Doug?
 
Ya, i was trying diff stuff with adding the underscore. You've got to add
the
'Window Title' string in order to be able to title your internet explorer
window.

Carl


"Dave Milne" <jeep@nospam.milne.info> wrote in message
news:JbqFi.12328$c_1.4752@text.news.blueyonder.co. uk...
>I don't have that key in mine fwiw. Internet Explorer doesn't have an
>underscore, and there is no Window underneath it.
>
> Dave Milne, Scotland
>
> Carl S wrote:
>> Doug,
>>
>> Here's what I've got so far.
>>
>> Set objShell = WScript.CreateObject("WScript.Shell")
>> Title = objShell.RegRead _
>> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>>
>> If Title = "Carl2" Then
>> Wscript.regwrite "carl3"
>> Else
>> Wscript.regwrite "carl7"
>> End If
>>
>> The problem is that no matter what combinaton I use to enter my path, it
>> says not found...
>>
>> Carl
>>
>>
>> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
>> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>>> Doug,
>>>
>>> I need to write a script to modify a registry entry of a given key
>>> with one of 3 values I will provide. The order it selects the new values
>>> isn't important, so long as it selects a different value each time. This
>>> can be a .exe or .bat, as I will be dropping it into the windows
>>> startup. It doesn't need to be pretty, but must require minimal user
>>> intervention.
>>>
>>> Can this be done without a code compiler?
>>>
>>> The last coding I did was years ago with C++.
>>>
>>> I was thinking something like pull the existing key and load into a
>>> variable, then compare the variable against a rule set and replace it
>>> accordingly.
>>>
>>> (script grabs value, assigns name 'value')
>>>
>>> 1 = "jeep"
>>> IF value="jeep" GOTO 2
>>>
>>> 2 = "wrangler"
>>> IF value="wrangler" GOTO 3
>>>
>>> 3 = "cherokee"
>>> IF value="cherokee" GOTO 1
>>>
>>> (script replaces value)
>>>
>>> Some pointers would be great..
>>>
>>> Carl
>>>

>>



Carl S 09-11-2007 02:13 AM

Re: Script question, Doug?
 
Ya, i was trying diff stuff with adding the underscore. You've got to add
the
'Window Title' string in order to be able to title your internet explorer
window.

Carl


"Dave Milne" <jeep@nospam.milne.info> wrote in message
news:JbqFi.12328$c_1.4752@text.news.blueyonder.co. uk...
>I don't have that key in mine fwiw. Internet Explorer doesn't have an
>underscore, and there is no Window underneath it.
>
> Dave Milne, Scotland
>
> Carl S wrote:
>> Doug,
>>
>> Here's what I've got so far.
>>
>> Set objShell = WScript.CreateObject("WScript.Shell")
>> Title = objShell.RegRead _
>> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>>
>> If Title = "Carl2" Then
>> Wscript.regwrite "carl3"
>> Else
>> Wscript.regwrite "carl7"
>> End If
>>
>> The problem is that no matter what combinaton I use to enter my path, it
>> says not found...
>>
>> Carl
>>
>>
>> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
>> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>>> Doug,
>>>
>>> I need to write a script to modify a registry entry of a given key
>>> with one of 3 values I will provide. The order it selects the new values
>>> isn't important, so long as it selects a different value each time. This
>>> can be a .exe or .bat, as I will be dropping it into the windows
>>> startup. It doesn't need to be pretty, but must require minimal user
>>> intervention.
>>>
>>> Can this be done without a code compiler?
>>>
>>> The last coding I did was years ago with C++.
>>>
>>> I was thinking something like pull the existing key and load into a
>>> variable, then compare the variable against a rule set and replace it
>>> accordingly.
>>>
>>> (script grabs value, assigns name 'value')
>>>
>>> 1 = "jeep"
>>> IF value="jeep" GOTO 2
>>>
>>> 2 = "wrangler"
>>> IF value="wrangler" GOTO 3
>>>
>>> 3 = "cherokee"
>>> IF value="cherokee" GOTO 1
>>>
>>> (script replaces value)
>>>
>>> Some pointers would be great..
>>>
>>> Carl
>>>

>>



Carl S 09-11-2007 02:13 AM

Re: Script question, Doug?
 
Ya, i was trying diff stuff with adding the underscore. You've got to add
the
'Window Title' string in order to be able to title your internet explorer
window.

Carl


"Dave Milne" <jeep@nospam.milne.info> wrote in message
news:JbqFi.12328$c_1.4752@text.news.blueyonder.co. uk...
>I don't have that key in mine fwiw. Internet Explorer doesn't have an
>underscore, and there is no Window underneath it.
>
> Dave Milne, Scotland
>
> Carl S wrote:
>> Doug,
>>
>> Here's what I've got so far.
>>
>> Set objShell = WScript.CreateObject("WScript.Shell")
>> Title = objShell.RegRead _
>> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>>
>> If Title = "Carl2" Then
>> Wscript.regwrite "carl3"
>> Else
>> Wscript.regwrite "carl7"
>> End If
>>
>> The problem is that no matter what combinaton I use to enter my path, it
>> says not found...
>>
>> Carl
>>
>>
>> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
>> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>>> Doug,
>>>
>>> I need to write a script to modify a registry entry of a given key
>>> with one of 3 values I will provide. The order it selects the new values
>>> isn't important, so long as it selects a different value each time. This
>>> can be a .exe or .bat, as I will be dropping it into the windows
>>> startup. It doesn't need to be pretty, but must require minimal user
>>> intervention.
>>>
>>> Can this be done without a code compiler?
>>>
>>> The last coding I did was years ago with C++.
>>>
>>> I was thinking something like pull the existing key and load into a
>>> variable, then compare the variable against a rule set and replace it
>>> accordingly.
>>>
>>> (script grabs value, assigns name 'value')
>>>
>>> 1 = "jeep"
>>> IF value="jeep" GOTO 2
>>>
>>> 2 = "wrangler"
>>> IF value="wrangler" GOTO 3
>>>
>>> 3 = "cherokee"
>>> IF value="cherokee" GOTO 1
>>>
>>> (script replaces value)
>>>
>>> Some pointers would be great..
>>>
>>> Carl
>>>

>>



Carl S 09-11-2007 02:13 AM

Re: Script question, Doug?
 
Ya, i was trying diff stuff with adding the underscore. You've got to add
the
'Window Title' string in order to be able to title your internet explorer
window.

Carl


"Dave Milne" <jeep@nospam.milne.info> wrote in message
news:JbqFi.12328$c_1.4752@text.news.blueyonder.co. uk...
>I don't have that key in mine fwiw. Internet Explorer doesn't have an
>underscore, and there is no Window underneath it.
>
> Dave Milne, Scotland
>
> Carl S wrote:
>> Doug,
>>
>> Here's what I've got so far.
>>
>> Set objShell = WScript.CreateObject("WScript.Shell")
>> Title = objShell.RegRead _
>> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>>
>> If Title = "Carl2" Then
>> Wscript.regwrite "carl3"
>> Else
>> Wscript.regwrite "carl7"
>> End If
>>
>> The problem is that no matter what combinaton I use to enter my path, it
>> says not found...
>>
>> Carl
>>
>>
>> "Carl S" <carlsaiyed@REMOVE.hotmail.com> wrote in message
>> news:e9Gdne3Ggv4fjnvbnZ2dnUVZ_r2nnZ2d@comcast.com. ..
>>> Doug,
>>>
>>> I need to write a script to modify a registry entry of a given key
>>> with one of 3 values I will provide. The order it selects the new values
>>> isn't important, so long as it selects a different value each time. This
>>> can be a .exe or .bat, as I will be dropping it into the windows
>>> startup. It doesn't need to be pretty, but must require minimal user
>>> intervention.
>>>
>>> Can this be done without a code compiler?
>>>
>>> The last coding I did was years ago with C++.
>>>
>>> I was thinking something like pull the existing key and load into a
>>> variable, then compare the variable against a rule set and replace it
>>> accordingly.
>>>
>>> (script grabs value, assigns name 'value')
>>>
>>> 1 = "jeep"
>>> IF value="jeep" GOTO 2
>>>
>>> 2 = "wrangler"
>>> IF value="wrangler" GOTO 3
>>>
>>> 3 = "cherokee"
>>> IF value="cherokee" GOTO 1
>>>
>>> (script replaces value)
>>>
>>> Some pointers would be great..
>>>
>>> Carl
>>>

>>



DougW 09-11-2007 07:42 AM

Re: Script question, Doug?
 
Carl S wrote:
> Ya, i was trying diff stuff with adding the underscore. You've got to
> add the
> 'Window Title' string in order to be able to title your internet
> explorer window.


It's one of those customization tweaks.

objShell.RegWrite strKey,strValue,"REG_SZ"
^^^^^^^^ your using Wscript ^^^^^^^ indicates your writing a string value


in the Set command, you Set objShell. For example, if you did

Set beermug = CreateObject("WScript.Shell")

then you would use

beermug.RegWrite ......


Hope this helps. I gotta get to $dayjob now.



> "Dave Milne" wrote ...
>> I don't have that key in mine fwiw. Internet Explorer doesn't have an
>> underscore, and there is no Window underneath it.
>>
>> Dave Milne, Scotland
>>
>> Carl S wrote:
>>> Doug,
>>>
>>> Here's what I've got so far.
>>>
>>> Set objShell = WScript.CreateObject("WScript.Shell")
>>> Title = objShell.RegRead _
>>> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>>>
>>> If Title = "Carl2" Then
>>> Wscript.regwrite "carl3"
>>> Else
>>> Wscript.regwrite "carl7"
>>> End If
>>>
>>> The problem is that no matter what combinaton I use to enter my
>>> path, it says not found...
>>>
>>> Carl


<snip>



DougW 09-11-2007 07:42 AM

Re: Script question, Doug?
 
Carl S wrote:
> Ya, i was trying diff stuff with adding the underscore. You've got to
> add the
> 'Window Title' string in order to be able to title your internet
> explorer window.


It's one of those customization tweaks.

objShell.RegWrite strKey,strValue,"REG_SZ"
^^^^^^^^ your using Wscript ^^^^^^^ indicates your writing a string value


in the Set command, you Set objShell. For example, if you did

Set beermug = CreateObject("WScript.Shell")

then you would use

beermug.RegWrite ......


Hope this helps. I gotta get to $dayjob now.



> "Dave Milne" wrote ...
>> I don't have that key in mine fwiw. Internet Explorer doesn't have an
>> underscore, and there is no Window underneath it.
>>
>> Dave Milne, Scotland
>>
>> Carl S wrote:
>>> Doug,
>>>
>>> Here's what I've got so far.
>>>
>>> Set objShell = WScript.CreateObject("WScript.Shell")
>>> Title = objShell.RegRead _
>>> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>>>
>>> If Title = "Carl2" Then
>>> Wscript.regwrite "carl3"
>>> Else
>>> Wscript.regwrite "carl7"
>>> End If
>>>
>>> The problem is that no matter what combinaton I use to enter my
>>> path, it says not found...
>>>
>>> Carl


<snip>



DougW 09-11-2007 07:42 AM

Re: Script question, Doug?
 
Carl S wrote:
> Ya, i was trying diff stuff with adding the underscore. You've got to
> add the
> 'Window Title' string in order to be able to title your internet
> explorer window.


It's one of those customization tweaks.

objShell.RegWrite strKey,strValue,"REG_SZ"
^^^^^^^^ your using Wscript ^^^^^^^ indicates your writing a string value


in the Set command, you Set objShell. For example, if you did

Set beermug = CreateObject("WScript.Shell")

then you would use

beermug.RegWrite ......


Hope this helps. I gotta get to $dayjob now.



> "Dave Milne" wrote ...
>> I don't have that key in mine fwiw. Internet Explorer doesn't have an
>> underscore, and there is no Window underneath it.
>>
>> Dave Milne, Scotland
>>
>> Carl S wrote:
>>> Doug,
>>>
>>> Here's what I've got so far.
>>>
>>> Set objShell = WScript.CreateObject("WScript.Shell")
>>> Title = objShell.RegRead _
>>> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>>>
>>> If Title = "Carl2" Then
>>> Wscript.regwrite "carl3"
>>> Else
>>> Wscript.regwrite "carl7"
>>> End If
>>>
>>> The problem is that no matter what combinaton I use to enter my
>>> path, it says not found...
>>>
>>> Carl


<snip>



DougW 09-11-2007 07:42 AM

Re: Script question, Doug?
 
Carl S wrote:
> Ya, i was trying diff stuff with adding the underscore. You've got to
> add the
> 'Window Title' string in order to be able to title your internet
> explorer window.


It's one of those customization tweaks.

objShell.RegWrite strKey,strValue,"REG_SZ"
^^^^^^^^ your using Wscript ^^^^^^^ indicates your writing a string value


in the Set command, you Set objShell. For example, if you did

Set beermug = CreateObject("WScript.Shell")

then you would use

beermug.RegWrite ......


Hope this helps. I gotta get to $dayjob now.



> "Dave Milne" wrote ...
>> I don't have that key in mine fwiw. Internet Explorer doesn't have an
>> underscore, and there is no Window underneath it.
>>
>> Dave Milne, Scotland
>>
>> Carl S wrote:
>>> Doug,
>>>
>>> Here's what I've got so far.
>>>
>>> Set objShell = WScript.CreateObject("WScript.Shell")
>>> Title = objShell.RegRead _
>>> ("HKCU\Software\Microsoft\Internet_Explorer\Main\W indow")
>>>
>>> If Title = "Carl2" Then
>>> Wscript.regwrite "carl3"
>>> Else
>>> Wscript.regwrite "carl7"
>>> End If
>>>
>>> The problem is that no matter what combinaton I use to enter my
>>> path, it says not found...
>>>
>>> Carl


<snip>



DougW 09-11-2007 08:32 PM

Re: Script question, Doug?
 
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

--------------------------------



DougW 09-11-2007 08:32 PM

Re: Script question, Doug?
 
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

--------------------------------



DougW 09-11-2007 08:32 PM

Re: Script question, Doug?
 
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

--------------------------------



DougW 09-11-2007 08:32 PM

Re: Script question, Doug?
 
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 S 09-11-2007 10:06 PM

Re: Script question, Doug?
 
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.

C:\When trying to run from a command prompt window, i get:
'Dim' is not recognized as a command

C:\Set objShell = WScript.CreateObject("WScript.Shell")

C:\On Error resume next
'on' is not a rec. command

C:\Title=ojbshell.regread _

C:\"HKCU\Software\Microsoft\Internet Explorer\Main\Window Title"
The system cannot find path specifified
< was unexpected at this time

c:\if err <> 0 then

I thought WSH was auto installed with windows?

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 S 09-11-2007 10:06 PM

Re: Script question, Doug?
 
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.

C:\When trying to run from a command prompt window, i get:
'Dim' is not recognized as a command

C:\Set objShell = WScript.CreateObject("WScript.Shell")

C:\On Error resume next
'on' is not a rec. command

C:\Title=ojbshell.regread _

C:\"HKCU\Software\Microsoft\Internet Explorer\Main\Window Title"
The system cannot find path specifified
< was unexpected at this time

c:\if err <> 0 then

I thought WSH was auto installed with windows?

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 S 09-11-2007 10:06 PM

Re: Script question, Doug?
 
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.

C:\When trying to run from a command prompt window, i get:
'Dim' is not recognized as a command

C:\Set objShell = WScript.CreateObject("WScript.Shell")

C:\On Error resume next
'on' is not a rec. command

C:\Title=ojbshell.regread _

C:\"HKCU\Software\Microsoft\Internet Explorer\Main\Window Title"
The system cannot find path specifified
< was unexpected at this time

c:\if err <> 0 then

I thought WSH was auto installed with windows?

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 S 09-11-2007 10:06 PM

Re: Script question, Doug?
 
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.

C:\When trying to run from a command prompt window, i get:
'Dim' is not recognized as a command

C:\Set objShell = WScript.CreateObject("WScript.Shell")

C:\On Error resume next
'on' is not a rec. command

C:\Title=ojbshell.regread _

C:\"HKCU\Software\Microsoft\Internet Explorer\Main\Window Title"
The system cannot find path specifified
< was unexpected at this time

c:\if err <> 0 then

I thought WSH was auto installed with windows?

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 S 09-11-2007 10:10 PM

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 S 09-11-2007 10:10 PM

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 S 09-11-2007 10:10 PM

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 S 09-11-2007 10:10 PM

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
>
> --------------------------------
>
>




DougW 09-11-2007 10:15 PM

Re: Script question, Doug?
 
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.


--
DougW



DougW 09-11-2007 10:15 PM

Re: Script question, Doug?
 
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.


--
DougW



DougW 09-11-2007 10:15 PM

Re: Script question, Doug?
 
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.


--
DougW



DougW 09-11-2007 10:15 PM

Re: Script question, Doug?
 
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.


--
DougW



DougW 09-11-2007 10:20 PM

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



DougW 09-11-2007 10:20 PM

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



DougW 09-11-2007 10:20 PM

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




All times are GMT -4. The time now is 10:56 PM.


© 2024 MH Sub I, LLC dba Internet Brands

Page generated in 0.05659 seconds with 5 queries