3.5框架,我想打一个bat文件,在Windows Server上安装.NET Framework 3.5 2012年 我想这样的,但没有成功:bat文件来安装.NET为Win Server 2012的
cd /D %userprofile%
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Import-Module ServerManager
powershell -ImportSystemModules Add-WindowsFeature NET-Framework-Features
似乎进入PowerShell控制台后,最后2个命令不执行。
有没有人有想法为什么会卡住?
还有没有人有其他bat文件如何自动安装.net 3.5在Windows Server 2012中?
经过更多的尝试,我做了蝙蝠工作时手动运行下面的命令。
call C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ImportSystemModules Add-WindowsFeature NET-Framework-Features
但是当我尝试从dotnetInstaller蝙蝠一样运行它不工作了
<component command="CMD.EXE /K "#APPPATH\Install.net3.5.bat"" command_silent="" command_basic="" uninstall_command="" uninstall_command_silent="" uninstall_command_basic="" returncodes_success="" returncodes_reboot="" disable_wow64_fs_redirection="False" id=".Net 3.5 SP1 Win8Server" display_name=".Net 3.5 SP1" uninstall_display_name="" os_filter="" os_filter_min="winServer2008R2" os_filter_max="" os_filter_lcid="" type="cmd" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="True" default_continue_on_error="False" required_install="True" required_uninstall="True" selected_install="True" selected_uninstall="True" note="" processor_architecture_filter="" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
<installedcheck path="SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" fieldname="Install" fieldvalue="1" defaultvalue="False" fieldtype="REG_DWORD" comparison="match" rootkey="HKEY_LOCAL_MACHINE" wowoption="NONE" type="check_registry_value" description="Installed Check" />
<installedcheck path="SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" fieldname="SP" fieldvalue="1" defaultvalue="False" fieldtype="REG_DWORD" comparison="match" rootkey="HKEY_LOCAL_MACHINE" wowoption="NONE" type="check_registry_value" description="Installed Check" />
</component>
我得到这个错误任何想法,为什么?
术语'Add-WindowsFeature'不被识别为cmdlet的名称,脚本文件或可操作程序。检查名称的拼写,或者如果包含,请验证路径是否正确,然后重试。 在行:1字符:19 +添加-WindowsFeature < < < < -name净框架的功能 + CategoryInfo:ObjectNotFound:(添加-WindowsFeature:字符串)[], CommandNotFoundException + FullyQualifiedErrorId:CommandNotFoundException