What command could I use to enable NTVDM? - ntvdm

I try to enable windows NTVDM feature to run 16-bit application on my windows 8 virtual machine .
I know how to enable NTVDM by windows control panel .
But I have no idea how to use command (wmic ? vb script ? ) to enable it in my batch file.
I appreciate your help , thanks .

Windows 8.1
To enable the Feature type:
dism /online /enable-feature /all /featurename:NTVDM
To disable the Feature type:
dism /online /disable-feature /featurename:NTVDM

First of all I'd like to say Thank You for answering your own question, this will help many people on Google. Now I would like to offer an alternative answer in case people come across this.
If you would like to do it in PowerShell you need to download this module https://psclientmanager.codeplex.com/
After installing the module you can use this in your Powershell script:
Import-Module PSClientManager
Add-ClientFeature –Name NTVDM
64-bit client operating systems do not have NTVDM, however there is an open source alternative that may work for your applications: http://sourceforge.net/projects/nxvdm/

For Command Prompt:
To enable NTVDM in Windows 8.1 (32-bit only):
dism /online /enable-feature /all /featurename:NTVDM /quiet /norestart
To disable NTVDM in Windows 8.1 (32-bit only):
dism /online /disable-feature /featurename:NTVDM /quiet /norestart

Finally I find that windows 8 have dism.exe command line tool to achieve this .
dism /online /enable-feature:ntvdm

In windows 8.1 open start screen, type ntvdm to search, and the ntvdm application will come first in the search result, right click it and run as administrator, it will install the ntvdm feature, after installing restart the windows to effect the changes. Thats it.

Related

wsl still not recognized after enabled in dism

I apologize if this was posted, I did go through a number of posts first.
I am attempting to run a linux VM on my desktop using WSL 2, however I continuously get the error: "'wsl' is not recognized as an internal or external command,
operable program or batch file."
I have enabled it multiple times using the command dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart in an elevated CMD.
Note: I am using the Microsoft Insiders Dev mode on my computer. I configured it today and did restart to settle the update.
It seems like you need to enable wsl from Windows Features.
Click Windows > Search "Turn Windows features on or off" > Open the
list of features > Select "Windows Subsystem for Linux", enable it and
restart
It is recommended to enable "Virtual Machine Platform" and "Hyper-V" as well.
Please refer to the image below.

Ansible 2.7 on windows 2012 does not accept /norestart option

I am experiencing a problem with /norestart option on Windows 2012, using ansible. Below is the code
win_package:
product_id: auto
path: 'C:\Path\to\file\file.exe'
become_method: runas
arguments: /silent /norestart
ensure: present
expected_return_code: [0,3010]
It installs software in silent mode, which automatically reboots the system. I want to avoid this reboot, but the norestart option is not working at all. Do you have any suggestions ?
the win_package module doesn't strip away commands, this would be an issue with the exe itself, if you add the actual program name it would help but I suggest running it yourself and see if it behaves the same or contact the vendor

devcon restart not working on windows7

I am trying to run devcon command on windows7 as below but this is stuck forever,if I right-click on "scan for hardware changes" it is stuck aswell,how can I activate a COM port via commandline using devcon?is there a better way?
devcon.exe restart "#USB\VID_05C6&PID_9302&MI_01\6&1E2FC975&0&0001"

Windows 7 embedded

Due to turn windows features on or off is blank, so I need to install IIS using command line, How can I install default IIS using command line?
I have found a solution to it. See: http://reboot.pro/topic/16383-windows-embedded-standard-7-add-packages-on-a-live-image/
Basically you need to get the .cab package from the installation dvd and then feed it to DISM, like: DISM.exe /online /Add-Package /PackagePath:C:\Temp /NoRestart
Have you try to use the optionalfeatures command? Are you administrator on the computer?
Also you can try the DISM if the above doesn't work for you.

Alternative way to install Message Queuing (MSMQ)

I have Windows 10 and "Turn Windows Features on or off" is empty.
So I can't add/install MSMQ using it.
I don't know when "Windows Features" window become this (empty) so I can't use Windows Restore (I don't know what date to choose and I've installed some programs last days so I don't want to use it anyway)
Is there an alternative way to enable MSMQ?
Run Windows PowerShell as Administrator.
To get a list of available features, Type Get-WindowsOptionalFeature -online | ft
Enable-WindowsOptionalFeature -online -FeatureName XXXXXX
Replace XXXXXX with the feature you wish to enable.
Yeah.. "Windows Features & Installed updates" empty/blank issue should be fixed anyway. Pretty easy Solution (works 100%):
download iso of your Win OS, for e.g. Windows 10 -
https://www.microsoft.com/en-us/software-download/techbench - free
to download any Win 10 from official MS servers..
just open this iso, run Setup.exe (windows explorer can easily open iso files itself, so you don't need flash device or dvd) and just update your OS:
your files, installed programs/apps will not be removed :) it just reinstalls system files
source: https://support.microsoft.com/ru-ru/kb/957310 - check
"Способ 4. Выполнить обновление на месте" - yeah it's in Russian and I don't know why English version doesn't have it...
https://support.microsoft.com/en-hk/kb/957310
p.s.
sfc /scannow or DISM.exe /Online /Cleanup-image /Restorehealth- none of this helped me, but you could try it first and see if it helps
you can also try MS "System Update Readiness" tool https://support.microsoft.com/en-hk/kb/947821 (I didn't use it but mb it also can fix it)

Resources