I am writing some VBA for an access database and I am having some problems. I have gotten my commands to work properly with static values in the code, now I need it to be based on varibles.
The code looks like this:
Dim cmd As String
cmd = "%comspec% /k title hello|cscript.exe C:\XCACLS.vbs "" & elevatedNetworkPath & "" /g ESELLC\ESE:;2 /E /SPEC B"
If ESEAccessible = True Then
Set objShell = CreateObject("Wscript.Shell")
objShell.Run (cmd), 0, True
The Code will work right if i use:
objShell.Run ("%comspec% /c title hello|cscript.exe C:\XCACLS.vbs ""Z:\folder"" /g ESELLC\ESE:;3 /E /SPEC B"), 0, True
When the code goes to execute, It just hangs and hangs until I close the form and hit the stop button. I have tried using different configurations of quotations (up to four on each side of the varible) - and did a Debug.print of both strings commands (with and without the varialbe) and the string is exactly the same in the Debug window.