WScript.Shell with Windows 10 Enterprise

418 Views Asked by At

Due to Updates to Windows 10 Enterprise our MS Access VBA script isn't working anymore. Everything was fine using Windwows 8.1.

Private Sub click_Click()
 Dim shell As Object
 Set shell = VBA.CreateObject("WScript.Shell")
 Dim waitTillComplete As Boolean: waitTillComplete = True
 Dim Style As Integer: Style = 2
 Dim errorCode As Long

 temp = "cmd.exe /k cd.."
 
 errorCode = shell.Run(temp, Style, waitTillComplete)
 
End Sub

The error occurs executing the .Run and returns

"Run-time error '70': Permission denied".

Any ideas to fix or work around the problem?

0

There are 0 best solutions below