1

I have a .BAT file that Silently installs .NET if it does not detect it in the registry. I'm having a couple issues though. The first is that if the .NET install takes too long, the .BAT times out and defaults to my '.NET install failed' error while the program is still installing. The second issue is that I think I set it up for a silent install, but the system still asks if you want to install .NET and with what settings. My code is below, is there anything I can do to make it function Properly?

:DOTNETBAD
   @Echo Installing .NET 3.5
   @echo:
   Start ""/wait "%~dp0\dotnetfx35setup.exe" /q /norestart
   if EXIST C:\Windows\Microsoft.NET\Framework64\v3.5 (GOTO DOTNETGOOD
   ) else (
   GOTO DOTNETFAIL
   )
  • 1
    Something to consider: If dotnetfx35setup runs, then launches another process to do the install, while closing the original dotnet35setup process, then the start /wait will continue as soon as the dotnet35setup.exe process ends, regardless of whether processes it launched are still running. – Ƭᴇcʜιᴇ007 Mar 9 '17 at 16:38
  • ""/wait should have a space before /wait. I've no idea if that is the cause of the problem though. – DavidPostill Mar 9 '17 at 16:47
  • Techie: Could I then, in theory, add another wait command based on the process name? Also, would you have any ideas on why the /q switch still prompts the user for install? It doesn't look like a standard security prompt, more like a confirmation from the .exe to download the resources it needs from Microsoft. – ThexTallxDude Mar 9 '17 at 18:11

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.