System.Data appartiene al framework .net
Forse ti manca il .net framework.
Prova in questo modo.
Visto che i file .bat sono deprecati morti e stramorti,
fai così guardian
Tranquillo è semplicemente un codice di PowerShell per windows
per verificare se hai il Framework 4 altrimenti te lo scarica ed installa automaticamente.
Apri il blocco notes.
incollaci questo codice
Write-Host " Mire Engine Dependecy Checker." -ForegroundColor "Cyan"
Write-Host ""
Write-Host "################################################################" -ForegroundColor "Red"
Write-Host ""
Write-Host "Checking to see if .Net Framework 4 is installed. Please wait..." -ForegroundColor "White"
Start-Sleep -Seconds 5
$DotNet4_Reg = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full').Install
If ($DotNet4_Reg -eq "1")
{
Write-Host ".Net 4 Framework is installed on this computer!" -ForegroundColor "White"
""
""
Write-Host "This script will now exit. Please wait..." -ForegroundColor "White"
Start-Sleep -Seconds 5
Exit
}
#EndRegion
#If the .Net 4 Framework is not installed, download and install it
#-----------------------------------------------------------------
#Region
ElseIf ($DotNet4_Reg -ne "1")
{
Write-Warning ".Net Framework 4 is not installed!"
$DotNet4_Inst_Prompt = 0
While ($DotNet4_Inst_Prompt -ne "Y", "y", "N", "n")
{
Write-Host "Please enter either Y or y for Yes, or N or n for No in the following prompt."
""
""
$DotNet4_Inst_Prompt = Read-Host "Would you like to download and install the .Net Framework 4?"
""
""
}
If ($DotNet4_Inst_Prompt -eq "Y", "y")
{
# Download the .Net Framework 4 from: http://www.microsoft.com/downloads/info.aspx?na=41&SrcFamilyId=0A391ABD-25C1-4FC0-919F-B21F31AB88B7&SrcDisplayLang=en&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f9%2f5%2fA%2f95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE%2fdotNetFx40_Full_x86_x64.exe
$DotNet4_Dwnld_Src = "http://www.microsoft.com/downloads/info.aspx?na=41&SrcFamilyId=0A391ABD-25C1-4FC0-919F-B21F31AB88B7&SrcDisplayLang=en&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f9%2f5%2fA%2f95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE%2fdotNetFx40_Full_x86_x64.exe"
$DotNet4_Dwnld_Dest = "$env:TEMP\dotNetFx40_Full_x86_x64.exe"
$WebClient = New-Object System.Net.WebClient
Try
{
$WebClient.DownloadFile("$DotNet4_Dwnld_Src", "$DotNet4_Dwnld_Dest")
If (Test-Path $DotNet4_Dwnld_Dest)
{
$InstLog = "/Log $env:TEMP\${env:COMPUTERNAME}.htm"
$Arguments = @()
$Arguments += "`"/passive`""
$Arguments += "`"/norestart`""
$Arguments += "`"$InstLog`""
$Inst_DotNet4 = (Start-Process "$DotNet4_Dwnld_Dest" -ArgumentList $Arguments -Wait -Passthru)
#If the exit code is 0, the SCCM 2012 Admin console successfully installed
If ($Inst_DotNet4.ExitCode -eq "0")
{
Write-Host "The .Net Framework 4 installation completed sucessfully!" -ForegroundColor "White"
""
""
Write-Host "This script will now exit. Please wait..." -ForegroundColor "White"
Start-Sleep -Seconds 5
Exit
}
#If the exit code is 3010, the SCCM 2012 Admin console successfully installed, but the system requires a restart
Elseif ($Inst_DotNet4.ExitCode -eq "3010")
{
Write-Host "The .Net Framework 4 installation completed sucessfully!" -ForegroundColor "White"
""
""
Write-Host "Your system requires a restart to complete the .Net Framework 4 installation." -ForegroundColor "White"
""
""
Write-Host "Please enter either "Y" or "y" for Yes, or "N" or "n" for No in the following prompt." -ForegroundColor "White"
""
""
$Inst_DotNet4_Prompt_Restart = 0
While ($Inst_DotNet4_Prompt_Restart -ne "Y", "y", "N", "n")
{
$Inst_DotNet4_Prompt_Restart = Read-Host -Prompt "Would you like to restart your computer now?"
}
If ($Inst_DotNet4_Prompt_Restart -eq "Y", "y")
{
Restart-Computer
}
ElseIf ($Inst_DotNet4_Prompt_Restart -eq "N", "n")
{
Write-Host "You chose not to restart your computer now!" -ForegroundColor "White"
""
""
Write-Host "This script will now exit!" -ForegroundColor "White"
""
""
Start-Sleep -Seconds 5
Exit
}
}
Else
{
Write-Error "Exit code cannot be determined!"
""
""
Write-Host "Please review the log file located here: '$env:COMPUTERNAME.htm'"
""
""
Write-Host "This script will now exit!" -ForegroundColor "White"
Start-Sleep -Seconds 5
Exit
}
}
}
Catch
{
Write-Error "An error occurred during the .Net Framework 4 download and install!"
""
""
$DotNet4_Local_UNC_Path_Prompt = 0
While ($DotNet4_Local_UNC_Path_Prompt -ne "Y", "y", "N", "n")
{
Write-Host "Please enter either "Y" or "y" for Yes, or "N" or "n" for No in the following prompt." -ForegroundColor "White"
""
""
$DotNet4_Local_UNC_Path_Prompt = Read-Host "Would you like to install a local .Net Framework 4 package?"
""
""
}
If ($DotNet4_Local_UNC_Path_Prompt -eq "Y" -or "y")
{
While (!($DotNet4_Local_UNC_Path))
{
$DotNet4_Local_UNC_Path = Read-Host = -Prompt "Please enter the local path or UNC path to the .Net Framework 4 package:"
""
""
}
$InstLog = "/Log $env:TEMP\${env:COMPUTERNAME}.htm"
$Arguments = @()
$Arguments += "`"/passive`""
$Arguments += "`"/norestart`""
$Arguments += "`"$InstLog`""
$Inst_DotNet4 = (Start-Process "$DotNet4_Local_UNC_Path" -ArgumentList $Arguments -Wait -Passthru)
#If the error code is 0, the SCCM 2012 Admin console successfully installed
If ($Inst_DotNet4.ExitCode -eq "0")
{
Write-Host "The .Net Framework 4 installation completed sucessfully!" -ForegroundColor "White"
""
""
Write-Host "This script will now exit. Please wait..." -ForegroundColor "White"
Start-Sleep -Seconds 5
Exit
}
#If the error code is 3010, the SCCM 2012 Admin console successfully installed, but the system requires a restart
Elseif ($Inst_DotNet4.ExitCode -eq "3010")
{
Write-Host "The .Net Framework 4 installation completed sucessfully!" -ForegroundColor "White"
""
""
Write-Host "Your system requires a restart to complete the .Net Framework 4 installation." -ForegroundColor "White"
""
""
Write-Host "Please enter either "Y" or "y" for Yes, or "N" or "n" for No in the following prompt." -ForegroundColor "White"
""
""
$Inst_DotNet4_Prompt_Restart = 0
While ($Inst_DotNet4_Prompt_Restart -ne "Y", "y", "N", "n")
{
$Inst_DotNet4_Prompt_Restart = Read-Host -Prompt "Would you like to restart your computer now?"
}
If ($Inst_DotNet4_Prompt_Restart -eq "Y", "y")
{
Restart-Computer
}
ElseIf ($Inst_DotNet4_Prompt_Restart -eq "N", "n")
{
Write-Host "You chose not to restart your computer now!" -ForegroundColor "White"
""
""
Write-Host "This script will now exit!" -ForegroundColor "White"
""
""
Start-Sleep -Seconds 5
Exit
}
}
Start-Sleep -Seconds 5
}
Write-Warning "Timed out" -ForegroundColor "White"
""
""
Write-Host "The script will now exit!" -ForegroundColor "White"
Start-Sleep -Seconds 5
Exit
}
ElseIf ($DotNet4_Local_UNC_Path_Prompt -eq "N", "n")
{
Write-Warning "You selected not to downlaod the .Net 4 Framework!"
""
""
$DotNet4_Local_UNC_Path_Prompt = 0
While ($DotNet4_Local_UNC_Path_Prompt -ne "Y", "y", "N", "n")
{
Write-Host "Please enter either "Y" or "y" for Yes, or "N" or "n" for No in the following prompt." -ForegroundColor "White"
""
""
$DotNet4_Local_UNC_Path_Prompt = Read-Host "Would you like to install a local .Net 4 package?" -ForegroundColor "White"
""
""
}
If ($DotNet4_Local_UNC_Path_Prompt -eq "Y" -or "y")
{
$DotNet4_Local_UNC_Path_Prompt = 0
While ($DotNet4_Local_UNC_Path_Prompt -ne "Y", "y", "N", "n")
{
Write-Host "Please enter either "Y" or "y" for Yes, or "N" or "n" for No in the following prompt." -ForegroundColor "White"
""
""
$DotNet4_Local_UNC_Path_Prompt = Read-Host "Would you like to install a local .Net Framework 4 package?"
""
""
}
If ($DotNet4_Local_UNC_Path_Prompt -eq "Y" -or "y")
{
$DotNet4_Local_UNC_Path = 0
While (!($DotNet4_Local_UNC_Path))
{
$DotNet4_Local_UNC_Path = Read-Host = -Prompt "Please enter the local path or UNC path to the .Net Framework 4 package:"
""
""
}
$InstLog = "/Log $env:TEMP\${env:COMPUTERNAME}.htm"
$Arguments = @()
$Arguments += "`"/passive`""
$Arguments += "`"/norestart`""
$Arguments += "`"$InstLog`""
$Inst_DotNet4 = (Start-Process "$DotNet4_Local_UNC_Path" -ArgumentList $Arguments -Wait -Passthru)
#If the error code is 0, the SCCM 2012 Admin console successfully installed
If ($Inst_DotNet4.ExitCode -eq "0")
{
Write-Host "The .Net Framework 4 installation completed sucessfully!" -ForegroundColor "White"
""
""
Write-Host "This script will now exit. Please wait..." -ForegroundColor "White"
Start-Sleep -Seconds 5
Exit
}
#If the error code is 3010, the SCCM 2012 Admin console successfully installed, but the system requires a restart
Elseif ($Inst_DotNet4.ExitCode -eq "3010")
{
Write-Host "The .Net Framework 4 installation completed sucessfully!" -ForegroundColor "White"
""
""
Write-Host "Your system requires a restart to complete the .Net Framework 4 installation." -ForegroundColor "White"
""
""
Write-Host "Please enter either "Y" or "y" for Yes, or "N" or "n" for No in the following prompt." -ForegroundColor "White"
""
""
$Inst_DotNet4_Prompt_Restart = 0
While ($Inst_DotNet4_Prompt_Restart -ne "Y", "y", "N", "n")
{
$Inst_DotNet4_Prompt_Restart = Read-Host -Prompt "Would you like to restart your computer now?"
}
If ($Inst_DotNet4_Prompt_Restart -eq "Y", "y")
{
Restart-Computer
}
ElseIf ($Inst_DotNet4_Prompt_Restart -eq "N", "n")
{
Write-Host "You chose not to restart your computer now!" -ForegroundColor "White"
""
""
Write-Host "This script will now exit!" -ForegroundColor "White"
""
""
Start-Sleep -Seconds 5
Exit
}
}
}
}
}
}
}
Fai salva con nome
e come estensione del file gli metti ps1
tipo Verifica.ps1
doppio click sul file è segui le istruzioni sul prompt
Da Sinistra verso Destra :P
Daemond, Thejuster, OldPat
Artwork by Hrot
Manca ancora lui XD
______________________________________________________
Produzione Software, Componenti e Controlli
_______________________________________________________
*** Linguaggi di Programmazione Conosciuti e competenze Tecniche ***
C#, Javascript, Java, PHP, SQL, Autoit , JQuery, HTML, HTML5, C++, VB.NET,
Android, DirectX, HLSL, XML, Access, LUA, Delphi, Pascal, Assembly, Fortan, Angular JS
Python, Delphi, OpenGL, Git, Bash, ASP, CMake, WinService
Tool per la creazione di MMO Rpg. Open Source,
Vuoi far parte del team di sviluppo?
Making Italia