Maybe something is different on the laptop. Have you tried adding a pause after each for? Post the output of bla.cmd on the laptop.
Hm i added some pause but not after every for Illl also reinstall 7 on it.. Edit: I addded echo pause 1 and pause after "call dec2hex %%a )" then echo pause 2 and pause after second for [dism online/...... !pkg! ) ) ) ] Seems like the script jumps directly to echch pause 3 which is right before "ec2hex" Hope you know what i mean
yep i know.. I ran the big script on my computer (where i removed zh-tw already) and it did the same as on my laptop. Seems like it shuts down if it cant find any languagepack besides the one in use(?) but i dont understand why it does that on my laptop:/..
What is the output of the following command on your laptop dism /Online /Get-Packages|find "LanguagePack"
Edit: Same as earlier but included swedish lp. Ill install windows 7 now.. should take roughly 20 minutes
How could that be? Try this dism /Online /Get-Packages|more press space for next screen and CTRL+C to break out of the command The first output of the above command will be the installed language pack.
Done reinstalling windows... Now this command seems to work fine Edit2: Ye its working from a script Edit3: dism /online /get-pacakges:more works fine.. Edit4: Ran the script from cmd (not rightclick and run as admin) and then i got "unexpected (". Or < but i doubt it
Tried it again to see if you missed or added too many ( or ) but coudnt see any.. Script still just shuts down.
Are you sure they are other additional language packs? The script works correctly if there is an additional language installed. It worked for you once on your desktop. Please give the output of bla.cmd on your laptop. Something has to be different on that laptop which I may have overlooked.
Well Ive used the same language packs on my computer, same source etc, ill try again then. Right after installing windows 7 hm. Edit: Ran dism /online /get-packages|find "languagePack" & it works fine. Code: Paketidentitet : Microsoft-Windows-Client-LanguagePack-Package~31bf3856ad364e35~x86~en-US~6.1.7600.16385 Paketidentitet : Microsoft-Windows-Client-LanguagePack-Package~31bf3856ad364e35~x86~sv-SE~6.1.7600.16385 Paketidentitet : Microsoft-Windows-Client-LanguagePack-Package~31bf3856ad364e35~x86~zh-TW~6.1.7600.16385 Ran wmic OS get OSLanguage & it works fine Code: DISM-verktyget (Deployment Image Servicing and Management) Version: 6.1.7600.16385 Avbildningsversion: 6.1.7600.16385 Rapporterar internationella inställningar online. Standardspråk för systemets användargränssnitt : sv-SE Användargränssnittets reservspråk är : en-US Systemspråkinställning : sv-SE Standardtidszon : W. Europe Standard Time Aktiva tangentbord : 041d:0000041d, 0409:00000409 Tangentbordsdrivrutin : Utökat PC/AT-tangentbord (101/102 tangenter) Installerade språk: en-US Typ: fullständigt lokaliserat språk. Installerade språk: sv-SE Typ: delvis lokaliserat språk, MUI-typ. Reservspråk en-US Installerade språk: zh-TW Typ: delvis lokaliserat språk, MUI-typ. Reservspråk en-US Åtgärden har slutförts. Ran the first code you posted & its not working.. Edit: Can i have the script ask me what languagepack to remove?
You mean this command does not work Code: for /f "tokens=2,* delims=:" %A in ('"dism /Online /Get-Packages|find "LanguagePack""') do @for /f "tokens=4 delims=~" %a in ("%A") do echo %a This is an important step, since the output of this command is used to compare with the locale variable. If you tried it in a batch file you need to add an additional % to %A and %a. For confirmation before deletion of a language pack add something like Code: for /f "tokens=2,* delims=:" %%A in ('"dism /Online /Get-Packages|find "LanguagePack""') do ( for /f "tokens=4 delims=~" %%a in ("%%A") do ( if NOT %locale%==%%a ( set /p confirm=Do you want to remove %%a? if /i %confirm%==y ( set pkg=%%A set pkg=!pkg: =! dism /online /Remove-Package /PackageName:!pkg! ) ELSE ( echo %%a will not be removed ) ) ) )
Wow i see i have alot more to learn about scripting So can I take the above script and replace it with your initial code you first posted?
Will try that.. replace Code: for /f "tokens=2,* delims=:" %%A in ('"dism /Online /Get-Packages|find "LanguagePack""') do ( for /f "tokens=4 delims=~" %%a in ("%%A") do ( if NOT %locale%==%%a ( set pkg=%%A set pkg=!pkg: =! dism /online /Remove-Package /PackageName:!pkg! ) ) ) with Code: for /f "tokens=2,* delims=:" %%A in ('"dism /Online /Get-Packages|find "LanguagePack""') do ( for /f "tokens=4 delims=~" %%a in ("%%A") do ( if NOT %locale%==%%a ( set /p confirm=Do you want to remove %%a? if /i %confirm%==y ( set pkg=%%A set pkg=!pkg: =! dism /online /Remove-Package /PackageName:!pkg! ) ELSE ( echo %%a will not be removed ) ) ) ) Correct?
Yes, that is correct What about the output of the first code snippet? Does it list the installed languages?
Tried that.. Still shuts down.. I get message: unexpected ) And yes the code Code: for /f "tokens=2,* delims=:" %A in ('"dism /Online /Get-Packages|find "LanguagePack""') do @for /f "tokens=4 delims=~" %a in ("%A") do echo %a works fine on my computer.