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