![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | registry keys I am pretty new to vbs and want to write a pure vbs (no html) that will do a few things concerning the desktop background for a current user. I know that the current background image is kept in the registry at HKEY_CURRENT_USER>Control Panel>Desktop>Wallpaper(REG_SZ) 1. I want to be able to copy the whole key straight out of the registry and save it to a user folder on my network. 2. I want to be able to read the string (path) of the key so I know exactly what image I need to save (where it lives) since they could be using an IE wallpaper or a windows one...no way to tell without manually digging. 3. I want to be able to add either add the whole key back to the registry and/or 4. I want to be able to write a new string directly back to the key once it is added. Reason being is my boss wants this done. He wants our corporate image saved to everyones profile when ever we have to create a new profile for someone, but he still wants to save their old wallpaper too, so they can change it back on their own. He says that way he is still carrying out the company standard, but the customer can still change it back if they want to so they will be happy too. He says that way neither corporate or the customers can complain. Any help that points to some really straight forward examples (or if you have some code yourself) would be greatly appreciated.... NewGuy |
My System Specs![]() |
| | #2 (permalink) |
| | Re: registry keys I found some code at msdn, but I am missing how to snag the actual string data within the key itself. They show how to get the DWORD values but not the string values. const HKEY_CURRENT_USER = &H80000001 strComputer = "." Set oReg=GetObject( _ "winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv") strKeyPath = "Control Panel\Desktop" strValueName = "Wallpaper" oReg.GetDWORDValue _ HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue WScript.Echo "Wallpaper Path = " & strValueName Any help would be great! NewGuy "NewGuy" <dontemailme@xxxxxx> wrote in message news:e4Nlux2FKHA.3392@xxxxxx Quote: >I am pretty new to vbs and want to write a pure vbs (no html) that will do >a few things concerning the desktop background for a current user. I know >that the current background image is kept in the registry at >HKEY_CURRENT_USER>Control Panel>Desktop>Wallpaper(REG_SZ) > > 1. I want to be able to copy the whole key straight out of the registry > and save it to a user folder on my network. > 2. I want to be able to read the string (path) of the key so I know > exactly what image I need to save (where it lives) since they could be > using an IE wallpaper or a windows one...no way to tell without manually > digging. > 3. I want to be able to add either add the whole key back to the registry > and/or > 4. I want to be able to write a new string directly back to the key once > it is added. > > Reason being is my boss wants this done. He wants our corporate image > saved to everyones profile when ever we have to create a new profile for > someone, but he still wants to save their old wallpaper too, so they can > change it back on their own. He says that way he is still carrying out > the company standard, but the customer can still change it back if they > want to so they will be happy too. He says that way neither corporate or > the customers can complain. Any help that points to some really straight > forward examples (or if you have some code yourself) would be greatly > appreciated.... > > NewGuy > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: registry keys "NewGuy" <dontemailme@xxxxxx> wrote in message news:e4Nlux2FKHA.3392@xxxxxx Quote: >I am pretty new to vbs and want to write a pure vbs (no html) that will do >a few things concerning the desktop background for a current user. I know >that the current background image is kept in the registry at >HKEY_CURRENT_USER>Control Panel>Desktop>Wallpaper(REG_SZ) > > 1. I want to be able to copy the whole key straight out of the registry > and save it to a user folder on my network. > 2. I want to be able to read the string (path) of the key so I know > exactly what image I need to save (where it lives) since they could be > using an IE wallpaper or a windows one...no way to tell without manually > digging. > 3. I want to be able to add either add the whole key back to the registry > and/or > 4. I want to be able to write a new string directly back to the key once > it is added. > > Reason being is my boss wants this done. He wants our corporate image > saved to everyones profile when ever we have to create a new profile for > someone, but he still wants to save their old wallpaper too, so they can > change it back on their own. He says that way he is still carrying out > the company standard, but the customer can still change it back if they > want to so they will be happy too. He says that way neither corporate or > the customers can complain. Any help that points to some really straight > forward examples (or if you have some code yourself) would be greatly > appreciated.... > > NewGuy can build on what others have already done for you. The following command will extract the wallpaper details for you: reg query "hkcu\Control Panel\Desktop" /v wallpaper You could also use reg.exe to modify an existing key. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: registry keys Pegasus, I am a true noob to programming, what would you recommend to capture the string data (shell.application, wscript.shell, fso)? NewGuy "Pegasus [MVP]" <news@xxxxxx> wrote in message news:e9Ccu13FKHA.3396@xxxxxx Quote: > > "NewGuy" <dontemailme@xxxxxx> wrote in message > news:e4Nlux2FKHA.3392@xxxxxx Quote: >>I am pretty new to vbs and want to write a pure vbs (no html) that will do >>a few things concerning the desktop background for a current user. I know >>that the current background image is kept in the registry at >>HKEY_CURRENT_USER>Control Panel>Desktop>Wallpaper(REG_SZ) >> >> 1. I want to be able to copy the whole key straight out of the registry >> and save it to a user folder on my network. >> 2. I want to be able to read the string (path) of the key so I know >> exactly what image I need to save (where it lives) since they could be >> using an IE wallpaper or a windows one...no way to tell without manually >> digging. >> 3. I want to be able to add either add the whole key back to the >> registry and/or >> 4. I want to be able to write a new string directly back to the key once >> it is added. >> >> Reason being is my boss wants this done. He wants our corporate image >> saved to everyones profile when ever we have to create a new profile for >> someone, but he still wants to save their old wallpaper too, so they can >> change it back on their own. He says that way he is still carrying out >> the company standard, but the customer can still change it back if they >> want to so they will be happy too. He says that way neither corporate or >> the customers can complain. Any help that points to some really straight >> forward examples (or if you have some code yourself) would be greatly >> appreciated.... >> >> NewGuy > You can re-invent the wheel with some fairly complex VB script or else you > can build on what others have already done for you. The following command > will extract the wallpaper details for you: > > reg query "hkcu\Control Panel\Desktop" /v wallpaper > > You could also use reg.exe to modify an existing key. > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: registry keys I fugured it out by playing with the example I posted earlier...just changed DWORD to SZ... const HKEY_CURRENT_USER = &H80000001 strComputer = "." Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") strKeyPath = "Control Panel\Desktop\" strKeyName = "Wallpaper" oReg.GetSTRINGValue HKEY_CURRENT_USER,strKeyPath,strKeyName,szValue WScript.Echo "Wallpaper Path = " & szValue New Guy "NewGuy" <dontemailme@xxxxxx> wrote in message news:e$s%23KT4FKHA.4004@xxxxxx Quote: > Pegasus, > > I am a true noob to programming, what would you recommend to capture the > string data (shell.application, wscript.shell, fso)? > > NewGuy > > "Pegasus [MVP]" <news@xxxxxx> wrote in message > news:e9Ccu13FKHA.3396@xxxxxx Quote: >> >> "NewGuy" <dontemailme@xxxxxx> wrote in message >> news:e4Nlux2FKHA.3392@xxxxxx Quote: >>>I am pretty new to vbs and want to write a pure vbs (no html) that will >>>do a few things concerning the desktop background for a current user. I >>>know that the current background image is kept in the registry at >>>HKEY_CURRENT_USER>Control Panel>Desktop>Wallpaper(REG_SZ) >>> >>> 1. I want to be able to copy the whole key straight out of the registry >>> and save it to a user folder on my network. >>> 2. I want to be able to read the string (path) of the key so I know >>> exactly what image I need to save (where it lives) since they could be >>> using an IE wallpaper or a windows one...no way to tell without manually >>> digging. >>> 3. I want to be able to add either add the whole key back to the >>> registry and/or >>> 4. I want to be able to write a new string directly back to the key >>> once it is added. >>> >>> Reason being is my boss wants this done. He wants our corporate image >>> saved to everyones profile when ever we have to create a new profile for >>> someone, but he still wants to save their old wallpaper too, so they can >>> change it back on their own. He says that way he is still carrying out >>> the company standard, but the customer can still change it back if they >>> want to so they will be happy too. He says that way neither corporate >>> or the customers can complain. Any help that points to some really >>> straight forward examples (or if you have some code yourself) would be >>> greatly appreciated.... >>> >>> NewGuy >> You can re-invent the wheel with some fairly complex VB script or else >> you can build on what others have already done for you. The following >> command will extract the wallpaper details for you: >> >> reg query "hkcu\Control Panel\Desktop" /v wallpaper >> >> You could also use reg.exe to modify an existing key. >> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: How can I delete registry keys | Vista installation & setup | |||
| What are these Registry Keys? | Vista General | |||
| RE: Missing Registry Keys | Vista hardware & devices | |||
| Re: Missing Registry Keys | Vista hardware & devices | |||
| BUG? Registry keys with / in names | PowerShell | |||