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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
merowingerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.