DotNetFX35 via VBS

Hello

I have done a lot of research on this topic, and struggling to get my VBS code to work properly. I basically need to deploy DotNet35 via VBS (Reasons I won't discuss).

Anyway, can someone help me write the below in VBS form.

If this folder doesn't exist "C:\WINDOWS\Microsoft.NET\Framework\v3.5"
Then run \\Server\Software_Packages\Dot Net Framework\wcu\dotNetFramework\dotNetFx35setup.exe /q /norestart
If the folder does exist then ignore the above.

I do have spaces in the UNC path, so not entirely sure where the double quotes would go.

Can anybody help?

Thanks.
mishcondereyaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
merowingerConnect With a Mentor Commented:
some changes.the below listed will choose the Windows folder automatically and wait until the application is installed
set objShell = CreateObject("Wscript.Shell") 
set objFSO = CreateObject("Scripting.FileSystemObject") 
 
If objFSO.FolderExists(objShell.ExpandEnvironmentStrings("%WINDIR%") &"\Microsoft.NET\Framework\v3.5") Then 
        objShell.Run chr(34) &"\\Server\Software_Packages\Dot Net Framework\wcu\dotNetFramework\dotNetFx35setup.exe" &chr(34) &" /q /norestart",1,true 
End If

Open in new window

0
 
merowingerCommented:
This should do it
set objShell = CreateObject("Wscript.Shell")
set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.FolderExists("C:\WINDOWS\Microsoft.NET\Framework\v3.5") Then
	objShell.Run chr(34) &"\\Server\Software_Packages\Dot Net Framework\wcu\dotNetFramework\dotNetFx35setup.exe" &chr(34) &" /q /norestart"
End If

Open in new window

0
 
mishcondereyaAuthor Commented:
Line 4 says FolderExists. I need to say if the folder doesn't exist then run the necessary install file.

Would it be;

objFSO.FolderDoesNotExist

???

Thanks.
0
 
merowingerCommented:
oh ok.

If not objFSO.FolderExists...
0
 
mishcondereyaAuthor Commented:
Top man!!!
0
All Courses

From novice to tech pro — start learning today.