I am building a script to cleanup certain temp folders and then run a install.exe file.
I have the cleaning of temp folders all working but cannot get the exe to run.
Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
Dim oFSO, strAppData, objShell
objShell = CreateObject("WScript.Shell")
oFSO = CreateObject("Scripting.FileSystemObject")
For Each sf In oFSO.GetFolder("C:Users").SubFolders
sf = oFSO.BuildPath(sf.Path, "Downloads")
If oFSO.FolderExists(sf) Then Shell("test.exe")
Next
End Sub`
I tried using the same way I was deleting the temp folders to locate the downloads folder and run the test.exe file but no luck
New contributor
VamperiX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.