# change a registry value for a AppVPackage

**URL:** <https://forums.powershell.org/t/change-a-registry-value-for-a-appvpackage/13760>\
**Category:** PowerShell Help\
**Created:** [February 4, 2020, 10:11am UTC](https://forums.powershell.org/t/change-a-registry-value-for-a-appvpackage/13760 "2020-02-04T10:11:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lopauli](https://avatars.discourse-cdn.com/v4/letter/l/ea5d25/32.png) [@lopauli](https://forums.powershell.org/u/lopauli)\
**Post date:** [February 4, 2020, 10:11am UTC](https://forums.powershell.org/t/change-a-registry-value-for-a-appvpackage/13760/1 "2020-02-04T10:11:54Z")

</div>

Hello,

I want to change a registry value for a AppVPackage by using below commands, but it’s not working. Any idea why?

```
$AppVName = Get-AppvClientPackage -PackageId ef1af223-8cc4-4622-a8c2-cd5af4308d05
$AppVName
Start-AppvVirtualProcess -AppvClientObject $AppVName cmd.exe
set-itemproperty HKCU:\Software\FRS\FiRE\Defaults JREPath C:\Program Files (x86)\Java\jre1.8.0_231
```

---

<div class="post-metadata">

**Author:** ![js2010](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@js2010](https://forums.powershell.org/u/js2010)\
**Post date:** [February 4, 2020, 10:44am UTC](https://forums.powershell.org/t/change-a-registry-value-for-a-appvpackage/13760/2 "2020-02-04T10:44:28Z")

</div>

I have no experience with this. I guess you have to run it under the cmd process. Or use reg.exe instead.

```
Start-AppvVirtualProcess -AppvClientObject $AppVName cmd.exe '/c powershell set-itemproperty HKCU:\Software\FRS\FiRE\Defaults JREPath "C:\Program Files (x86)\Java\jre1.8.0_231"'
```

Or this? I’m not sure if the argumentlist can be an array or a space seperated string, or maybe both work, if it’s like start-process:

```
Start-AppvVirtualProcess -AppvClientObject $AppVName -filepath powershell -argumentlist set-itemproperty, HKCU:\Software\FRS\FiRE\Defaults, JREPath, "C:\Program Files (x86)\Java\jre1.8.0_231"
```

---

<div class="post-metadata">

**Author:** ![grokkit](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/grokkit/32/970_2.png) [@grokkit](https://forums.powershell.org/u/grokkit)\
**Post date:** [February 5, 2020, 1:33pm UTC](https://forums.powershell.org/t/change-a-registry-value-for-a-appvpackage/13760/3 "2020-02-05T13:33:40Z")

</div>

```
set-itemproperty HKCU:\Software\FRS\FiRE\Defaults JREPath C:\Program Files (x86)\Java\jre1.8.0_231
```

The immediate problem is that the spaces in **C:\Program Files (x86)\Java\jre1.8.0\_231** are causing PowerShell to be unable to interpret your input parameters. You should always wrap paths in quotes so that the shell doesn’t parse special characters and spaces:

```
set-itemproperty 'HKCU:\Software\FRS\FiRE\Defaults' JREPath 'C:\Program Files (x86)\Java\jre1.8.0_231'
```

Also, for the sake of safety when editing the registry, you should specify each parameter explicitly rather than using the shorthand method. Every [tutorial](https://4sysops.com/archives/interacting-with-the-registry-in-powershell/) about [registry editing](https://blog.netwrix.com/2018/09/11/how-to-get-edit-create-and-delete-registry-keys-with-powershell/) with [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-entries?view=powershell-7), and the [documentation for Set-ItemProperty](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-itemproperty?view=powershell-7), shows the full parameter names being typed out.

```
Set-ItemProperty -Path 'HKCU:\Software\FRS\FiRE\Defaults' -Name 'JREPath' -Value 'C:\Program Files (x86)\Java\jre1.8.0_231'
```

It pays to be careful with the registry.

---

<div class="post-metadata">

**Author:** ![js2010](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@js2010](https://forums.powershell.org/u/js2010)\
**Post date:** [February 5, 2020, 1:36pm UTC](https://forums.powershell.org/t/change-a-registry-value-for-a-appvpackage/13760/4 "2020-02-05T13:36:15Z")

</div>

Note that set-itemproperty has a -Type parameter with registry paths, but it’s not documented in an obvious place.

---

<div class="post-metadata">

**Author:** ![lopauli](https://avatars.discourse-cdn.com/v4/letter/l/ea5d25/32.png) [@lopauli](https://forums.powershell.org/u/lopauli)\
**Post date:** [February 7, 2020, 3:08am UTC](https://forums.powershell.org/t/change-a-registry-value-for-a-appvpackage/13760/5 "2020-02-07T03:08:46Z")

</div>

> [@](#):
>
> \<textarea class="ace\_text-input" style="opacity: 0; height: 18px; width: 6.59781px; left: 44px; top: 0px;" spellcheck="false" wrap="off"\>\</textarea\>
> 
> 1
> 
> set-itemproperty HKCU:\Software\FRS\FiRE\Defaults JREPath C:\Program Files (x86)\Java\jre1.8.0\_231
> 
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> 
> The immediate problem is that the spaces in **C:\Program Files (x86)\Java\jre1.8.0\_231** are causing PowerShell to be unable to interpret your input parameters. You should always wrap paths in quotes so that the shell doesn't parse special characters and spaces:
> \<textarea class="ace\_text-input" style="opacity: 0; height: 18px; width: 6.59781px; left: 426.673px; top: 0px;" spellcheck="false" wrap="off"\>\</textarea\>
> 
> 1
> 
> set-itemproperty 'HKCU:\Software\FRS\FiRE\Defaults' JREPath 'C:\Program Files (x86)\Java\jre1.8.0\_231'
> 
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> 
> Also, for the sake of safety when editing the registry, you should specify each parameter explicitly rather than using the shorthand method. Every [tutorial](https://4sysops.com/archives/interacting-with-the-registry-in-powershell/) about [registry editing](https://blog.netwrix.com/2018/09/11/how-to-get-edit-create-and-delete-registry-keys-with-powershell/) with [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-entries?view=powershell-7), and the [documentation for Set-ItemProperty](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-itemproperty?view=powershell-7), shows the full parameter names being typed out.
> \<textarea class="ace\_text-input" style="opacity: 0; height: 18px; width: 6.59781px; left: 44px; top: 0px;" spellcheck="false" wrap="off"\>\</textarea\>
> 
> 1
> 
> Set-ItemProperty -Path 'HKCU:\Software\FRS\FiRE\Defaults' -Name 'JREPath' -Value 'C:\Program Files (x86)\Java\jre1.8.0\_231'
> 
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> 
> It pays to be careful with the registry.

Ok, the below ‘Set-ItemProperty’ command is working, but the registry change is not done in the registry for the AppVpackage rather in the normal window registry. How can I load the virtual registry appV package before the ‘Set-ItemProperty’ command?

&nbsp;

---

<div class="post-metadata">

**Author:** ![grokkit](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/grokkit/32/970_2.png) [@grokkit](https://forums.powershell.org/u/grokkit)\
**Post date:** [February 7, 2020, 11:03am UTC](https://forums.powershell.org/t/change-a-registry-value-for-a-appvpackage/13760/6 "2020-02-07T11:03:09Z")

</div>

I think this is what you’re looking for: [How to Configure the App-V Client Registry Settings by Using the Command Line](https://docs.microsoft.com/en-us/microsoft-desktop-optimization-pack/appv-v4/how-to-configure-the-app-v-client-registry-settings-by-using-the-command-line), and specifically this part:

> **Important** On a 64-bit computer, the keys and values described in the following sections will be under HKEY\_LOCAL\_MACHINE\SOFTWARE\Wow6432Node\Microsoft\SoftGrid\4.5\Client

I think the registry subkeys for the AppV client will be listed under that path, but I don't have an AppV environment to check it. You'll have to look through your own registry to verify.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:30pm UTC](https://forums.powershell.org/t/change-a-registry-value-for-a-appvpackage/13760/7 "2024-05-16T20:30:40Z")

</div>


