Windows 10: Get-WinHomeLocation and Write a registry string value to a specified location using PowerShell

Discus and support Get-WinHomeLocation and Write a registry string value to a specified location using PowerShell in Windows 10 Software and Apps to solve the problem; Hi,im trying to detect the current windows home location and write a new string value in the Registry for a specified location using a Power Shell... Discussion in 'Windows 10 Software and Apps' started by MujahithMuzamil, Jan 27, 2022.

  1. Get-WinHomeLocation and Write a registry string value to a specified location using PowerShell


    Hi,im trying to detect the current windows home location and write a new string value in the Registry for a specified location using a Power Shell Script. Scenario is as below1. i use Get-WinHomeLocation to get the result and result will be below GeoId HomeLocation ----- ------------ 42 Sri Lanka 2. I want to match the Geoid = 42 and Write a new registry string as "Country" mention the value as "LK"3. same commands need to be included to all the available countries.Please help me on thisRegardsMujahith

    :)
     
    MujahithMuzamil, Jan 27, 2022
    #1
  2. H Notneb Win User

    Locked Powershell startup command in context menu

    Since updating to Windows Anniversary Edition, there is an inaccessible Powershell command in my startup context menu.

    There are two keys, one each for 'Directory' and 'Drive'.

    On both the program is listed as "Open Powershell window here",

    and the file command is: powershell.exe -noexit -command Set-Location '%V'



    What is this, and why is it here.

    I have tried to both disable, and to delete it. Both FAIL. Access is denied.



    I have even gone to the registry location and attempted to put a (-) before the default value string.

    This action should disable the item. I have also tried to delete the value string for the entire item.

    With both of these maneuvers I am told that I cannot edit value string.



    I have taken ownership of, and given all users full access to Powershell.exe, and tried all of these step again,

    AND IT STILL WILL NOT DISABLE OR DELETE!!!



    Has anyone else run into this?
     
    H Notneb, Jan 27, 2022
    #2
  3. Roohi_Taj Win User
    PowerShell 1 Execution policy is bad in registry

    Hi SusanHout1,

    Thank you for writing to Microsoft Community Forums.

    Could you please help me with the below questions:

    • What is the make and model of the computer?
    • What is the version of Windows installed on your computer?
    • Have you logged into the computer with the admin account?
    • When do you get this error message?

    I have reviewed the information provided by you and I appreciate the time you have taken to resolve this issue, I realize how frustrating these things can be. We at Microsoft prioritize our customer’s satisfaction. Keeping that
    in mind, I will suggest you the steps which might take care of this issue.


    I would suggest you to run the scan on the computer using Windows defender. To do so, follow the Microsoft article on
    Help protect my PC with Windows Defender Offline.
    Once the scan is done, check if the issue is fixed or help us with the error message.

    To turn off controlled access on Windows 10, follow the steps mentioned in the article
    Allow a blocked app in Windows Security.


    To fix the
    PowerShell 1 ExecutionPolicy, I suggest you to follow these steps.

    Note: Serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry
    before you modify it. Then, you can restore the registry if a problem occurs. To backup and restore registry key, refer Microsoft article on How to back up and restore the registry in Windows.


    1. Press Windows andR
      key together on your Keyboard.
    2. Type Regedit and hit enter.
    3. Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell
    4. In the right pane, right click on the empty area and select New > select DWORD (32-BIT VALUE).
    5. Type: ExecutionPolicy
    6. Set the string value ExecutionPolicy to one of the following values:
      Restricted, AllSigned, RemoteSigned, Unrestricted, Undefined.


    Get-WinHomeLocation and Write a registry string value to a specified location using PowerShell 75b60ff9-d483-4190-8962-efd4e86269ba?upload=true.png


    If you would like me to provide additional advice, simply respond to this thread. I will get notified and I’ll reply to you as soon as I can.

    Hope it helps.

    Roohi Taj S

    Microsoft Community - Moderator
     
    Roohi_Taj, Jan 27, 2022
    #3
  4. Get-WinHomeLocation and Write a registry string value to a specified location using PowerShell

    How to restore registry values?

    Hello,

    Thank you for posting your query on Microsoft Community.

    You can perform system restore and check if it helps:

    Perform System restore.

    I suggest you to perform system restore and select a date prior to the changes which was done with the registry values and check if the issue gets fixed.

    To perform System restore:

    • Press Windows key + X, select
      System.
    • In the left pane, click on System Protection.
    • Select the option to system restore
      > next. It will show all restore points already created.
    • Select the date prior to the date on which you have made the registry changes.
    Registry disclaimer

    To do so: Important this section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these
    steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article
    in the Microsoft Knowledge Base:

    322756 (http://support.microsoft.com/kb/322756/ )

    How to back up and restore the registry in Windows



    Try the above step and let us know the status of the issue. We will be glad to assist you further.

    Thank you.
     
    Sangeeta Sarkar, Jan 27, 2022
    #4
Thema:

Get-WinHomeLocation and Write a registry string value to a specified location using PowerShell

Loading...
  1. Get-WinHomeLocation and Write a registry string value to a specified location using PowerShell - Similar Threads - WinHomeLocation Write registry

  2. Can i edit multi-string values of the Registry from Windows Recovery?

    in Windows 10 BSOD Crashes and Debugging
    Can i edit multi-string values of the Registry from Windows Recovery?: Specifically can I re-insert a worde.g EPMVolFlt into the value of the multi-string, while accessing the Registry, using the CMD, from the Windows Recovery screen? I cant boot into Windows. I need to note, that i can't import my backed up Registry either. The message that...
  3. Cannot create value or key, Error writing to the registry

    in Windows 10 News
    Cannot create value or key, Error writing to the registry: [IMG]When some Windows users tried creating value or key in Registry Editor, they failed due to lack of permission or misconfiguration. This issue is mainly caused when the user doesn’t have permission to access or perform actions on the folder under which they are trying to...
  4. Get-WinHomeLocation and Write a registry string value to a specified location using PowerShell

    in Windows 10 Customization
    Get-WinHomeLocation and Write a registry string value to a specified location using PowerShell: Hi,im trying to detect the current windows home location and write a new string value in the Registry for a specified location using a Power Shell Script. Scenario is as below1. i use Get-WinHomeLocation to get the result and result will be below GeoId HomeLocation -----...
  5. Get-WinHomeLocation and Write a registry string value to a specified location using PowerShell

    in Windows 10 Gaming
    Get-WinHomeLocation and Write a registry string value to a specified location using PowerShell: Hi,im trying to detect the current windows home location and write a new string value in the Registry for a specified location using a Power Shell Script. Scenario is as below1. i use Get-WinHomeLocation to get the result and result will be below GeoId HomeLocation -----...
  6. How to modify Registry values using Windows PowerShell

    in Windows 10 News
    How to modify Registry values using Windows PowerShell: [ATTACH]A Registry entry can be easily modified using Registry Editor. However, in a case […] This article How to modify Registry values using Windows PowerShell first appeared on TheWindowsClub.com. read more...
  7. RegSetValueExW failed to write value name and value data to registry

    in Windows 10 Customization
    RegSetValueExW failed to write value name and value data to registry: RegSetValueExW Unicode version of function failed to write the value name and value data to registry in windows 10. The value name contains more than 1000 characters,value data contains 16,000 characters. RegSetValueExW function return returns ERROR_SUCCESS but the value...
  8. reg save -> ERROR: The system was unable to find the specified registry key or value Registry

    in Windows 10 BSOD Crashes and Debugging
    reg save -> ERROR: The system was unable to find the specified registry key or value Registry: I would like to save/backup all registry entries that accumulate over a while in a certain part of the registry. Ultimately, I would to have that done more or less automatically with a batch file triggered by the Task Scheduler So far I have tried in the command window which...
  9. Registry Editor Values are not getting listed

    in Windows 10 Customization
    Registry Editor Values are not getting listed: Hello, I wanted to read the registry values for example VisualFXSetting,But in the registry editor it is not visible image attached for reference. I have to run my read application in both admin and non admin rights Machines,Kindly help me is there any other way to read...
  10. Powershell string parsing

    in Windows 10 Support
    Powershell string parsing: Lets say I have a string with several columns separated by spaces. The number of spaces and the data in each column are unknown. How would you grab what's in col3 using PowerShell? I know how I would do it with Awk, but that won't necessarily be available to me. col1 col2...