Hi all,
I need help for writing a vbscript or batch file for changing a registry key
value.

Be specific I need to change the outlook default temporary store location to
their temp folder path for all users at a time on a computer.
The registry key path:
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder

Facing problem: vbscript is not recongnizing the %userprofile%\path whereas
in batch script I am not able to change the data value after exporting the
key.

Can someone please help me out?

Re: Script for changing the registry key value by Jeremy

Jeremy
Thu Jun 21 03:00:45 CDT 2007

Use the WShellExpandEnvironmentStrings method to put the value in a variable

set WshShell = WScript.CreateObject("WScript.Shell")
strTemDir=WshShell.ExpandEnvironmentStrings("%TEMP%")

"sekhar" <sekhar@discussions.microsoft.com> wrote in message
news:457B8A55-88EE-4F0F-AFA9-5927CE46CE07@microsoft.com...
> Hi all,
> I need help for writing a vbscript or batch file for changing a registry
> key
> value.
>
> Be specific I need to change the outlook default temporary store location
> to
> their temp folder path for all users at a time on a computer.
> The registry key path:
> HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder
>
> Facing problem: vbscript is not recongnizing the %userprofile%\path
> whereas
> in batch script I am not able to change the data value after exporting the
> key.
>
> Can someone please help me out?
>


Re: Script for changing the registry key value by sekhar

sekhar
Thu Jun 21 04:29:01 CDT 2007

Hi Jeremy,
While creating a folder in the temp location I am getting the below run time
error:
Type mismatch: '[string: "C:\DOCUME~1\TEST~1\"]'

"Jeremy" wrote:

> Use the WShellExpandEnvironmentStrings method to put the value in a variable
>
> set WshShell = WScript.CreateObject("WScript.Shell")
> strTemDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
>
> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> news:457B8A55-88EE-4F0F-AFA9-5927CE46CE07@microsoft.com...
> > Hi all,
> > I need help for writing a vbscript or batch file for changing a registry
> > key
> > value.
> >
> > Be specific I need to change the outlook default temporary store location
> > to
> > their temp folder path for all users at a time on a computer.
> > The registry key path:
> > HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder
> >
> > Facing problem: vbscript is not recongnizing the %userprofile%\path
> > whereas
> > in batch script I am not able to change the data value after exporting the
> > key.
> >
> > Can someone please help me out?
> >
>

Re: Script for changing the registry key value by Jeremy

Jeremy
Thu Jun 21 06:01:56 CDT 2007

Well the method simply puts the value of the variable in a string. Please
post the code you are using to create the folder.

"sekhar" <sekhar@discussions.microsoft.com> wrote in message
news:BAF62CDC-7377-4A3A-979B-5BB92E5C17B5@microsoft.com...
> Hi Jeremy,
> While creating a folder in the temp location I am getting the below run
> time
> error:
> Type mismatch: '[string: "C:\DOCUME~1\TEST~1\"]'
>
> "Jeremy" wrote:
>
>> Use the WShellExpandEnvironmentStrings method to put the value in a
>> variable
>>
>> set WshShell = WScript.CreateObject("WScript.Shell")
>> strTemDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
>>
>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> news:457B8A55-88EE-4F0F-AFA9-5927CE46CE07@microsoft.com...
>> > Hi all,
>> > I need help for writing a vbscript or batch file for changing a
>> > registry
>> > key
>> > value.
>> >
>> > Be specific I need to change the outlook default temporary store
>> > location
>> > to
>> > their temp folder path for all users at a time on a computer.
>> > The registry key path:
>> > HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder
>> >
>> > Facing problem: vbscript is not recongnizing the %userprofile%\path
>> > whereas
>> > in batch script I am not able to change the data value after exporting
>> > the
>> > key.
>> >
>> > Can someone please help me out?
>> >
>>


Re: Script for changing the registry key value by sekhar

sekhar
Thu Jun 21 06:09:00 CDT 2007

Here you go:

Dim fso,fldr,strTempDir
Set fso = CreateObject("Scripting.FileSystemObject")
set WshShell = WScript.CreateObject("WScript.Shell")
strTempDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
Set fldr= fso.CreateFolder(strTempDir\OLK2)

"Jeremy" wrote:

> Well the method simply puts the value of the variable in a string. Please
> post the code you are using to create the folder.
>
> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> news:BAF62CDC-7377-4A3A-979B-5BB92E5C17B5@microsoft.com...
> > Hi Jeremy,
> > While creating a folder in the temp location I am getting the below run
> > time
> > error:
> > Type mismatch: '[string: "C:\DOCUME~1\TEST~1\"]'
> >
> > "Jeremy" wrote:
> >
> >> Use the WShellExpandEnvironmentStrings method to put the value in a
> >> variable
> >>
> >> set WshShell = WScript.CreateObject("WScript.Shell")
> >> strTemDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
> >>
> >> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> >> news:457B8A55-88EE-4F0F-AFA9-5927CE46CE07@microsoft.com...
> >> > Hi all,
> >> > I need help for writing a vbscript or batch file for changing a
> >> > registry
> >> > key
> >> > value.
> >> >
> >> > Be specific I need to change the outlook default temporary store
> >> > location
> >> > to
> >> > their temp folder path for all users at a time on a computer.
> >> > The registry key path:
> >> > HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder
> >> >
> >> > Facing problem: vbscript is not recongnizing the %userprofile%\path
> >> > whereas
> >> > in batch script I am not able to change the data value after exporting
> >> > the
> >> > key.
> >> >
> >> > Can someone please help me out?
> >> >
> >>
>

Re: Script for changing the registry key value by Grand_Poobah

Grand_Poobah
Thu Jun 21 07:06:42 CDT 2007

The last line should be:

Set fldr= fso.CreateFolder(strTempDir & "\OLK2")

GP

--->
> Here you go:
>
> Dim fso,fldr,strTempDir
> Set fso = CreateObject("Scripting.FileSystemObject")
> set WshShell = WScript.CreateObject("WScript.Shell")
> strTempDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
> Set fldr= fso.CreateFolder(strTempDir\OLK2)
>
> "Jeremy" wrote:
>
>> Well the method simply puts the value of the variable in a string. Please
>> post the code you are using to create the folder.
>>
>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> news:BAF62CDC-7377-4A3A-979B-5BB92E5C17B5@microsoft.com...
>>> Hi Jeremy,
>>> While creating a folder in the temp location I am getting the below run
>>> time
>>> error:
>>> Type mismatch: '[string: "C:\DOCUME~1\TEST~1\"]'
>>>
>>> "Jeremy" wrote:
>>>
>>>> Use the WShellExpandEnvironmentStrings method to put the value in a
>>>> variable
>>>>
>>>> set WshShell = WScript.CreateObject("WScript.Shell")
>>>> strTemDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
>>>>
>>>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>>>> news:457B8A55-88EE-4F0F-AFA9-5927CE46CE07@microsoft.com...
>>>>> Hi all,
>>>>> I need help for writing a vbscript or batch file for changing a
>>>>> registry
>>>>> key
>>>>> value.
>>>>>
>>>>> Be specific I need to change the outlook default temporary store
>>>>> location
>>>>> to
>>>>> their temp folder path for all users at a time on a computer.
>>>>> The registry key path:
>>>>> HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder
>>>>>
>>>>> Facing problem: vbscript is not recongnizing the %userprofile%\path
>>>>> whereas
>>>>> in batch script I am not able to change the data value after exporting
>>>>> the
>>>>> key.
>>>>>
>>>>> Can someone please help me out?
>>>>>

Re: Script for changing the registry key value by sekhar

sekhar
Fri Jun 22 01:21:02 CDT 2007

Then how can I add this expanded folder path to the registry key value? Can
someone help me?

"Grand_Poobah" wrote:

> The last line should be:
>
> Set fldr= fso.CreateFolder(strTempDir & "\OLK2")
>
> GP
>
> --->
> > Here you go:
> >
> > Dim fso,fldr,strTempDir
> > Set fso = CreateObject("Scripting.FileSystemObject")
> > set WshShell = WScript.CreateObject("WScript.Shell")
> > strTempDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
> > Set fldr= fso.CreateFolder(strTempDir\OLK2)
> >
> > "Jeremy" wrote:
> >
> >> Well the method simply puts the value of the variable in a string. Please
> >> post the code you are using to create the folder.
> >>
> >> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> >> news:BAF62CDC-7377-4A3A-979B-5BB92E5C17B5@microsoft.com...
> >>> Hi Jeremy,
> >>> While creating a folder in the temp location I am getting the below run
> >>> time
> >>> error:
> >>> Type mismatch: '[string: "C:\DOCUME~1\TEST~1\"]'
> >>>
> >>> "Jeremy" wrote:
> >>>
> >>>> Use the WShellExpandEnvironmentStrings method to put the value in a
> >>>> variable
> >>>>
> >>>> set WshShell = WScript.CreateObject("WScript.Shell")
> >>>> strTemDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
> >>>>
> >>>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> >>>> news:457B8A55-88EE-4F0F-AFA9-5927CE46CE07@microsoft.com...
> >>>>> Hi all,
> >>>>> I need help for writing a vbscript or batch file for changing a
> >>>>> registry
> >>>>> key
> >>>>> value.
> >>>>>
> >>>>> Be specific I need to change the outlook default temporary store
> >>>>> location
> >>>>> to
> >>>>> their temp folder path for all users at a time on a computer.
> >>>>> The registry key path:
> >>>>> HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder
> >>>>>
> >>>>> Facing problem: vbscript is not recongnizing the %userprofile%\path
> >>>>> whereas
> >>>>> in batch script I am not able to change the data value after exporting
> >>>>> the
> >>>>> key.
> >>>>>
> >>>>> Can someone please help me out?
> >>>>>
>

Re: Script for changing the registry key value by Jeremy

Jeremy
Fri Jun 22 03:21:40 CDT 2007

So you want to:
1: Find out the value of the user's Temp folder
2: Create a subfolder under it
3: Change the value of the key below to this same value?

Is this right?
If so, I think you are alreay 90% of the way there. Just look on the
technet script center repositry for the code snippet to create/modify a
REG_SZ value.


"sekhar" <sekhar@discussions.microsoft.com> wrote in message
news:8A6AC5D7-CA47-43B7-887D-4EB6E22EE209@microsoft.com...
> Then how can I add this expanded folder path to the registry key value?
> Can
> someone help me?
>
> "Grand_Poobah" wrote:
>
>> The last line should be:
>>
>> Set fldr= fso.CreateFolder(strTempDir & "\OLK2")
>>
>> GP
>>
>> --->
>> > Here you go:
>> >
>> > Dim fso,fldr,strTempDir
>> > Set fso = CreateObject("Scripting.FileSystemObject")
>> > set WshShell = WScript.CreateObject("WScript.Shell")
>> > strTempDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
>> > Set fldr= fso.CreateFolder(strTempDir\OLK2)
>> >
>> > "Jeremy" wrote:
>> >
>> >> Well the method simply puts the value of the variable in a string.
>> >> Please
>> >> post the code you are using to create the folder.
>> >>
>> >> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> >> news:BAF62CDC-7377-4A3A-979B-5BB92E5C17B5@microsoft.com...
>> >>> Hi Jeremy,
>> >>> While creating a folder in the temp location I am getting the below
>> >>> run
>> >>> time
>> >>> error:
>> >>> Type mismatch: '[string: "C:\DOCUME~1\TEST~1\"]'
>> >>>
>> >>> "Jeremy" wrote:
>> >>>
>> >>>> Use the WShellExpandEnvironmentStrings method to put the value in a
>> >>>> variable
>> >>>>
>> >>>> set WshShell = WScript.CreateObject("WScript.Shell")
>> >>>> strTemDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
>> >>>>
>> >>>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> >>>> news:457B8A55-88EE-4F0F-AFA9-5927CE46CE07@microsoft.com...
>> >>>>> Hi all,
>> >>>>> I need help for writing a vbscript or batch file for changing a
>> >>>>> registry
>> >>>>> key
>> >>>>> value.
>> >>>>>
>> >>>>> Be specific I need to change the outlook default temporary store
>> >>>>> location
>> >>>>> to
>> >>>>> their temp folder path for all users at a time on a computer.
>> >>>>> The registry key path:
>> >>>>> HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder
>> >>>>>
>> >>>>> Facing problem: vbscript is not recongnizing the %userprofile%\path
>> >>>>> whereas
>> >>>>> in batch script I am not able to change the data value after
>> >>>>> exporting
>> >>>>> the
>> >>>>> key.
>> >>>>>
>> >>>>> Can someone please help me out?
>> >>>>>
>>


Re: Script for changing the registry key value by sekhar

sekhar
Fri Jun 22 04:38:00 CDT 2007

hi jeremy,
Can you please mention the exact url link? I could not find this.

"Jeremy" wrote:

> So you want to:
> 1: Find out the value of the user's Temp folder
> 2: Create a subfolder under it
> 3: Change the value of the key below to this same value?
>
> Is this right?
> If so, I think you are alreay 90% of the way there. Just look on the
> technet script center repositry for the code snippet to create/modify a
> REG_SZ value.
>
>
> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> news:8A6AC5D7-CA47-43B7-887D-4EB6E22EE209@microsoft.com...
> > Then how can I add this expanded folder path to the registry key value?
> > Can
> > someone help me?
> >
> > "Grand_Poobah" wrote:
> >
> >> The last line should be:
> >>
> >> Set fldr= fso.CreateFolder(strTempDir & "\OLK2")
> >>
> >> GP
> >>
> >> --->
> >> > Here you go:
> >> >
> >> > Dim fso,fldr,strTempDir
> >> > Set fso = CreateObject("Scripting.FileSystemObject")
> >> > set WshShell = WScript.CreateObject("WScript.Shell")
> >> > strTempDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
> >> > Set fldr= fso.CreateFolder(strTempDir\OLK2)
> >> >
> >> > "Jeremy" wrote:
> >> >
> >> >> Well the method simply puts the value of the variable in a string.
> >> >> Please
> >> >> post the code you are using to create the folder.
> >> >>
> >> >> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> >> >> news:BAF62CDC-7377-4A3A-979B-5BB92E5C17B5@microsoft.com...
> >> >>> Hi Jeremy,
> >> >>> While creating a folder in the temp location I am getting the below
> >> >>> run
> >> >>> time
> >> >>> error:
> >> >>> Type mismatch: '[string: "C:\DOCUME~1\TEST~1\"]'
> >> >>>
> >> >>> "Jeremy" wrote:
> >> >>>
> >> >>>> Use the WShellExpandEnvironmentStrings method to put the value in a
> >> >>>> variable
> >> >>>>
> >> >>>> set WshShell = WScript.CreateObject("WScript.Shell")
> >> >>>> strTemDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
> >> >>>>
> >> >>>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> >> >>>> news:457B8A55-88EE-4F0F-AFA9-5927CE46CE07@microsoft.com...
> >> >>>>> Hi all,
> >> >>>>> I need help for writing a vbscript or batch file for changing a
> >> >>>>> registry
> >> >>>>> key
> >> >>>>> value.
> >> >>>>>
> >> >>>>> Be specific I need to change the outlook default temporary store
> >> >>>>> location
> >> >>>>> to
> >> >>>>> their temp folder path for all users at a time on a computer.
> >> >>>>> The registry key path:
> >> >>>>> HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder
> >> >>>>>
> >> >>>>> Facing problem: vbscript is not recongnizing the %userprofile%\path
> >> >>>>> whereas
> >> >>>>> in batch script I am not able to change the data value after
> >> >>>>> exporting
> >> >>>>> the
> >> >>>>> key.
> >> >>>>>
> >> >>>>> Can someone please help me out?
> >> >>>>>
> >>
>

Re: Script for changing the registry key value by Jeremy

Jeremy
Fri Jun 22 05:28:58 CDT 2007

http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true

"sekhar" <sekhar@discussions.microsoft.com> wrote in message
news:E22FA031-2516-4EB7-9F0D-61BC86240D8E@microsoft.com...
> hi jeremy,
> Can you please mention the exact url link? I could not find this.
>
> "Jeremy" wrote:
>
>> So you want to:
>> 1: Find out the value of the user's Temp folder
>> 2: Create a subfolder under it
>> 3: Change the value of the key below to this same value?
>>
>> Is this right?
>> If so, I think you are alreay 90% of the way there. Just look on the
>> technet script center repositry for the code snippet to create/modify a
>> REG_SZ value.
>>
>>
>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> news:8A6AC5D7-CA47-43B7-887D-4EB6E22EE209@microsoft.com...
>> > Then how can I add this expanded folder path to the registry key value?
>> > Can
>> > someone help me?
>> >
>> > "Grand_Poobah" wrote:
>> >
>> >> The last line should be:
>> >>
>> >> Set fldr= fso.CreateFolder(strTempDir & "\OLK2")
>> >>
>> >> GP
>> >>
>> >> --->
>> >> > Here you go:
>> >> >
>> >> > Dim fso,fldr,strTempDir
>> >> > Set fso = CreateObject("Scripting.FileSystemObject")
>> >> > set WshShell = WScript.CreateObject("WScript.Shell")
>> >> > strTempDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
>> >> > Set fldr= fso.CreateFolder(strTempDir\OLK2)
>> >> >
>> >> > "Jeremy" wrote:
>> >> >
>> >> >> Well the method simply puts the value of the variable in a string.
>> >> >> Please
>> >> >> post the code you are using to create the folder.
>> >> >>
>> >> >> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> >> >> news:BAF62CDC-7377-4A3A-979B-5BB92E5C17B5@microsoft.com...
>> >> >>> Hi Jeremy,
>> >> >>> While creating a folder in the temp location I am getting the
>> >> >>> below
>> >> >>> run
>> >> >>> time
>> >> >>> error:
>> >> >>> Type mismatch: '[string: "C:\DOCUME~1\TEST~1\"]'
>> >> >>>
>> >> >>> "Jeremy" wrote:
>> >> >>>
>> >> >>>> Use the WShellExpandEnvironmentStrings method to put the value in
>> >> >>>> a
>> >> >>>> variable
>> >> >>>>
>> >> >>>> set WshShell = WScript.CreateObject("WScript.Shell")
>> >> >>>> strTemDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
>> >> >>>>
>> >> >>>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> >> >>>> news:457B8A55-88EE-4F0F-AFA9-5927CE46CE07@microsoft.com...
>> >> >>>>> Hi all,
>> >> >>>>> I need help for writing a vbscript or batch file for changing a
>> >> >>>>> registry
>> >> >>>>> key
>> >> >>>>> value.
>> >> >>>>>
>> >> >>>>> Be specific I need to change the outlook default temporary store
>> >> >>>>> location
>> >> >>>>> to
>> >> >>>>> their temp folder path for all users at a time on a computer.
>> >> >>>>> The registry key path:
>> >> >>>>> HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder
>> >> >>>>>
>> >> >>>>> Facing problem: vbscript is not recongnizing the
>> >> >>>>> %userprofile%\path
>> >> >>>>> whereas
>> >> >>>>> in batch script I am not able to change the data value after
>> >> >>>>> exporting
>> >> >>>>> the
>> >> >>>>> key.
>> >> >>>>>
>> >> >>>>> Can someone please help me out?
>> >> >>>>>
>> >>
>>


Re: Script for changing the registry key value by Jeremy

Jeremy
Fri Jun 22 05:29:18 CDT 2007

http://www.microsoft.com/technet/scriptcenter/scripts/os/registry/osrgvb04.mspx?mfr=true

"sekhar" <sekhar@discussions.microsoft.com> wrote in message
news:E22FA031-2516-4EB7-9F0D-61BC86240D8E@microsoft.com...
> hi jeremy,
> Can you please mention the exact url link? I could not find this.
>
> "Jeremy" wrote:
>
>> So you want to:
>> 1: Find out the value of the user's Temp folder
>> 2: Create a subfolder under it
>> 3: Change the value of the key below to this same value?
>>
>> Is this right?
>> If so, I think you are alreay 90% of the way there. Just look on the
>> technet script center repositry for the code snippet to create/modify a
>> REG_SZ value.
>>
>>
>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> news:8A6AC5D7-CA47-43B7-887D-4EB6E22EE209@microsoft.com...
>> > Then how can I add this expanded folder path to the registry key value?
>> > Can
>> > someone help me?
>> >
>> > "Grand_Poobah" wrote:
>> >
>> >> The last line should be:
>> >>
>> >> Set fldr= fso.CreateFolder(strTempDir & "\OLK2")
>> >>
>> >> GP
>> >>
>> >> --->
>> >> > Here you go:
>> >> >
>> >> > Dim fso,fldr,strTempDir
>> >> > Set fso = CreateObject("Scripting.FileSystemObject")
>> >> > set WshShell = WScript.CreateObject("WScript.Shell")
>> >> > strTempDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
>> >> > Set fldr= fso.CreateFolder(strTempDir\OLK2)
>> >> >
>> >> > "Jeremy" wrote:
>> >> >
>> >> >> Well the method simply puts the value of the variable in a string.
>> >> >> Please
>> >> >> post the code you are using to create the folder.
>> >> >>
>> >> >> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> >> >> news:BAF62CDC-7377-4A3A-979B-5BB92E5C17B5@microsoft.com...
>> >> >>> Hi Jeremy,
>> >> >>> While creating a folder in the temp location I am getting the
>> >> >>> below
>> >> >>> run
>> >> >>> time
>> >> >>> error:
>> >> >>> Type mismatch: '[string: "C:\DOCUME~1\TEST~1\"]'
>> >> >>>
>> >> >>> "Jeremy" wrote:
>> >> >>>
>> >> >>>> Use the WShellExpandEnvironmentStrings method to put the value in
>> >> >>>> a
>> >> >>>> variable
>> >> >>>>
>> >> >>>> set WshShell = WScript.CreateObject("WScript.Shell")
>> >> >>>> strTemDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
>> >> >>>>
>> >> >>>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> >> >>>> news:457B8A55-88EE-4F0F-AFA9-5927CE46CE07@microsoft.com...
>> >> >>>>> Hi all,
>> >> >>>>> I need help for writing a vbscript or batch file for changing a
>> >> >>>>> registry
>> >> >>>>> key
>> >> >>>>> value.
>> >> >>>>>
>> >> >>>>> Be specific I need to change the outlook default temporary store
>> >> >>>>> location
>> >> >>>>> to
>> >> >>>>> their temp folder path for all users at a time on a computer.
>> >> >>>>> The registry key path:
>> >> >>>>> HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder
>> >> >>>>>
>> >> >>>>> Facing problem: vbscript is not recongnizing the
>> >> >>>>> %userprofile%\path
>> >> >>>>> whereas
>> >> >>>>> in batch script I am not able to change the data value after
>> >> >>>>> exporting
>> >> >>>>> the
>> >> >>>>> key.
>> >> >>>>>
>> >> >>>>> Can someone please help me out?
>> >> >>>>>
>> >>
>>


Re: Script for changing the registry key value by sekhar

sekhar
Fri Jun 22 06:49:00 CDT 2007

Jeremy,

I am able to add values to the registry key using wshshell.regwrite command,
but I want to add the exact expanded value of the folder path to the
registry. Please help me out on this.

"Jeremy" wrote:

> http://www.microsoft.com/technet/scriptcenter/scripts/os/registry/osrgvb04.mspx?mfr=true
>
> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> news:E22FA031-2516-4EB7-9F0D-61BC86240D8E@microsoft.com...
> > hi jeremy,
> > Can you please mention the exact url link? I could not find this.
> >
> > "Jeremy" wrote:
> >
> >> So you want to:
> >> 1: Find out the value of the user's Temp folder
> >> 2: Create a subfolder under it
> >> 3: Change the value of the key below to this same value?
> >>
> >> Is this right?
> >> If so, I think you are alreay 90% of the way there. Just look on the
> >> technet script center repositry for the code snippet to create/modify a
> >> REG_SZ value.
> >>
> >>
> >> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> >> news:8A6AC5D7-CA47-43B7-887D-4EB6E22EE209@microsoft.com...
> >> > Then how can I add this expanded folder path to the registry key value?
> >> > Can
> >> > someone help me?
> >> >
> >> > "Grand_Poobah" wrote:
> >> >
> >> >> The last line should be:
> >> >>
> >> >> Set fldr= fso.CreateFolder(strTempDir & "\OLK2")
> >> >>
> >> >> GP
> >> >>
> >> >> --->
> >> >> > Here you go:
> >> >> >
> >> >> > Dim fso,fldr,strTempDir
> >> >> > Set fso = CreateObject("Scripting.FileSystemObject")
> >> >> > set WshShell = WScript.CreateObject("WScript.Shell")
> >> >> > strTempDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
> >> >> > Set fldr= fso.CreateFolder(strTempDir\OLK2)
> >> >> >
> >> >> > "Jeremy" wrote:
> >> >> >
> >> >> >> Well the method simply puts the value of the variable in a string.
> >> >> >> Please
> >> >> >> post the code you are using to create the folder.
> >> >> >>
> >> >> >> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> >> >> >> news:BAF62CDC-7377-4A3A-979B-5BB92E5C17B5@microsoft.com...
> >> >> >>> Hi Jeremy,
> >> >> >>> While creating a folder in the temp location I am getting the
> >> >> >>> below
> >> >> >>> run
> >> >> >>> time
> >> >> >>> error:
> >> >> >>> Type mismatch: '[string: "C:\DOCUME~1\TEST~1\"]'
> >> >> >>>
> >> >> >>> "Jeremy" wrote:
> >> >> >>>
> >> >> >>>> Use the WShellExpandEnvironmentStrings method to put the value in
> >> >> >>>> a
> >> >> >>>> variable
> >> >> >>>>
> >> >> >>>> set WshShell = WScript.CreateObject("WScript.Shell")
> >> >> >>>> strTemDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
> >> >> >>>>
> >> >> >>>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
> >> >> >>>> news:457B8A55-88EE-4F0F-AFA9-5927CE46CE07@microsoft.com...
> >> >> >>>>> Hi all,
> >> >> >>>>> I need help for writing a vbscript or batch file for changing a
> >> >> >>>>> registry
> >> >> >>>>> key
> >> >> >>>>> value.
> >> >> >>>>>
> >> >> >>>>> Be specific I need to change the outlook default temporary store
> >> >> >>>>> location
> >> >> >>>>> to
> >> >> >>>>> their temp folder path for all users at a time on a computer.
> >> >> >>>>> The registry key path:
> >> >> >>>>> HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder
> >> >> >>>>>
> >> >> >>>>> Facing problem: vbscript is not recongnizing the
> >> >> >>>>> %userprofile%\path
> >> >> >>>>> whereas
> >> >> >>>>> in batch script I am not able to change the data value after
> >> >> >>>>> exporting
> >> >> >>>>> the
> >> >> >>>>> key.
> >> >> >>>>>
> >> >> >>>>> Can someone please help me out?
> >> >> >>>>>
> >> >>
> >>
>

Re: Script for changing the registry key value by Jeremy

Jeremy
Fri Jun 22 19:05:14 CDT 2007

So you want to append a value onto another? is that right?

Then first query the current value, save it into a string variable, then
write the value back with the second value appended to it with the ampersand
(&) as shown in a previous example.
"sekhar" <sekhar@discussions.microsoft.com> wrote in message
news:6A0B57E0-297B-4E21-843B-E927DBBA6EEC@microsoft.com...
> Jeremy,
>
> I am able to add values to the registry key using wshshell.regwrite
> command,
> but I want to add the exact expanded value of the folder path to the
> registry. Please help me out on this.
>
> "Jeremy" wrote:
>
>> http://www.microsoft.com/technet/scriptcenter/scripts/os/registry/osrgvb04.mspx?mfr=true
>>
>> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> news:E22FA031-2516-4EB7-9F0D-61BC86240D8E@microsoft.com...
>> > hi jeremy,
>> > Can you please mention the exact url link? I could not find this.
>> >
>> > "Jeremy" wrote:
>> >
>> >> So you want to:
>> >> 1: Find out the value of the user's Temp folder
>> >> 2: Create a subfolder under it
>> >> 3: Change the value of the key below to this same value?
>> >>
>> >> Is this right?
>> >> If so, I think you are alreay 90% of the way there. Just look on the
>> >> technet script center repositry for the code snippet to create/modify
>> >> a
>> >> REG_SZ value.
>> >>
>> >>
>> >> "sekhar" <sekhar@discussions.microsoft.com> wrote in message
>> >> news:8A6AC5D7-CA47-43B7-887D-4EB6E22EE209@microsoft.com...
>> >> > Then how can I add this expanded folder path to the registry key
>> >> > value?
>> >> > Can
>> >> > someone help me?
>> >> >
>> >> > "Grand_Poobah" wrote:
>> >> >
>> >> >> The last line should be:
>> >> >>
>> >> >> Set fldr= fso.CreateFolder(strTempDir & "\OLK2")
>> >> >>
>> >> >> GP
>> >> >>
>> >> >> --->
>> >> >> > Here you go:
>> >> >> >
>> >> >> > Dim fso,fldr,strTempDir
>> >> >> > Set fso = CreateObject("Scripting.FileSystemObject")
>> >> >> > set WshShell = WScript.CreateObject("WScript.Shell")
>> >> >> > strTempDir=WshShell.ExpandEnvironmentStrings("%TEMP%")
>> >> >> > Set fldr= fso.CreateFolder(strTempDir\OLK2)
>> >> >> >
>> >> >> > "Jeremy" wrote:
>> >> >> >
>> >> >> >> Well the method simply puts the value of the variable in a
>> >> >> >> string.
>> >> >> >> Please
>&