Jump to content

cmd screen does not appear


Recommended Posts

cmd screen does not appear

#RequireAdmin

Global $Sysdir, $NetFrameRegKey, $NetFrameInsRegKey

If @OSArch = "X64" Then
    $Sysdir = @WindowsDir & "\SysWOW64\"
Else
    $Sysdir = @SystemDir
EndIf

$NetFrameRegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5"
$NetFrameInsRegKey = "Install"

If RegRead($NetFrameRegKey, $NetFrameInsRegKey) = 1 Then
    MsgBox(0, "info", ".Net Framework 3.5 already installed ")
Else
    If @OSVersion = "WIN_10" Then
        $sPathWin10 = @ScriptDir & "\Netfix\Win10\" & @OSArch
        $CMD = $Sysdir & 'Dism.exe /online /enable-feature /featurename:NetFx3 /source:' & $sPathWin10 & ' /LimitAccess'
        RunWait('"' & @ComSpec & '" /k ' & $CMD, '', '', @SW_SHOW)
    EndIf
EndIf

 

Link to comment
Share on other sites

I'm getting 64-bit and 32-bit error so you have an idea about this

Spoiler

P1VlON.png

#RequireAdmin
#include <WinaPIFiles.au3>
Global $Sysdir, $NetFrameRegKey, $NetFrameInsRegKey

If @OSArch = "X64" Then
    $Sysdir = @WindowsDir & "\SysWOW64\"
Else
    $Sysdir = @SystemDir
EndIf

$NetFrameRegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5"
$NetFrameInsRegKey = "Install"

If RegRead($NetFrameRegKey, $NetFrameInsRegKey) = 1 Then
    MsgBox(0, "info", ".Net Framework 3.5 already installed ")
Else
    If @OSVersion = "WIN_10" And @OSArch = "X64" Then
        Local $stOldVal = DllStructCreate("dword")
        DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "ptr", DllStructGetPtr($stOldVal))
;~      _Wow64FsRedirection(False)
;~      _WinAPI_Wow64EnableWow64FsRedirection(False)
        $sPathWin10 = @ScriptDir & "\Netfix\Win10\" & @OSArch
        $CMD = $Sysdir & '\Dism.exe /online /enable-feature /featurename:NetFx3 /source:' & $sPathWin10 & ' /LimitAccess'
        RunWait('"' & @ComSpec & '" /k ' & $CMD, '', @SW_SHOW)
        DllCall("kernel32.dll", "int", "Wow64RevertWow64FsRedirection", "ptr", DllStructGetPtr($stOldVal))
;~      _WinAPI_Wow64EnableWow64FsRedirection(True)
;~ _Wow64FsRedirection(True)
    EndIf
EndIf

Func _Wow64FsRedirection($state) ;alternativeWow64
    ; Disables or reverts the filesystem redirector for a 32 bit process running on 64bit OS
    If Not @AutoItX64 And @OSArch = 'X64' Then
        If $state Then
            DllCall("kernel32.dll", "int", "Wow64RevertWow64FsRedirection", "int", 0)
        Else
            DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 0) ; or 1 as per help
        EndIf
        If @error Then Return SetError(1)
    EndIf
EndFunc   ;==>_Wow64FsRedirection

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...