User Tools

Site Tools


microsoft:scripting:batchfiles:notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
microsoft:scripting:batchfiles:notes [2024/11/25 16:47] – Added the headline "Calculate a time X minutes from now". basmicrosoft:scripting:batchfiles:notes [2025/09/10 14:36] (current) – Corrected typo "exemple" -> "example" and added net localgroup version for groupnames at [Determine Windows InstallLanguage]. bas
Line 166: Line 166:
 =====Determine Windows InstallLanguage===== =====Determine Windows InstallLanguage=====
  
-To use with for exemple net localgroup commands with localized group names.+To use with for example net localgroup commands with localized group names.
  
 <code batch> <code batch>
Line 192: Line 192:
  
 Source: [[https://stackoverflow.com/questions/1610337/how-can-i-find-the-current-windows-language-from-cmd|stack overflow - How can I find the current Windows language from cmd?]] Source: [[https://stackoverflow.com/questions/1610337/how-can-i-find-the-current-windows-language-from-cmd|stack overflow - How can I find the current Windows language from cmd?]]
 +
 +This works better if you want to use the correct groupname, as InstallLanguage does not always work accurately for this:
 +
 +<code batch>
 +REM Determine the correct group name to use.
 +"%SYSTEMROOT%\system32\net.exe" localgroup Users > nul
 +IF %ERRORLEVEL% EQU 0 SET USERGRP=Users
 +
 +"%SYSTEMROOT%\system32\net.exe" localgroup Gebruikers > nul
 +IF %ERRORLEVEL% EQU 0 SET USERGRP=Gebruikers
 +</code>
  
  
microsoft/scripting/batchfiles/notes.txt · Last modified: 2025/09/10 14:36 by bas

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki