Gerges Boshra
Gerges Boshra

Reputation: 11

How to get windows user language list using the CMD shell?

I am unable to get the windows user language list using CMD line command.

I have used get-winuserlanguagelist in PowerShell but I need its equivalent cmd command. For I face a troubleshooting issue on some PCs which are restricted by PowerShell policy.

Hence on those restricted PCs, I only have the CMD shell to solve this issue of being able to remove an extra language that user doesn't need.

Note: Also Region & Language settings are disabled according to policy permissions.

Upvotes: 1

Views: 2380

Answers (2)

stackprotector
stackprotector

Reputation: 13570

The restriction only applies to the execution of scripts. It is not a real security measure, it's only there to prevent users from accidentally run PS scripts. Here are some of many ways to bypass the resrtiction without applying changes to the system:

  1. Run PS from CMD and pass your command with the -Command parameter:
    powershell -Command "Get-WinUserLanguageList"
    
    You can pass multiple lines (aka a script) by separating the lines by ;:
    powershell -Command "Get-WinUserLanguageList; Write-Host 'Hello World!'"
    
  2. Run PS from CMD and pass your code to stdin:
    echo Get-WinUserLanguageList | powershell 
    
  3. Run PS from CMD, bypass the execution policy and execute a script file:
    powershell -ExecutionPolicy Bypass -File .\my_script.ps1
    

Upvotes: 3

ΩmegaMan
ΩmegaMan

Reputation: 31686

If a computer is restricted from changing such things by policy, then its up to the admin of the network to run a PowerShell script at an elevated level to change such things.

Otherwise, allowing such changes means viruses could change the user experience for the worse.

The direction one should take is to create the PowerShell script, but one needs to run it at an admin level of authority.

Upvotes: 2

Related Questions