I have the following code to write a file to the Windows System folder.
I know I need Administrator rights to do so which I do. Is there a way in VBA to force it to write since the Logged in User has Administrator rights? If so, how can I do it?
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim Fileout As Object
Set Fileout = fso.CreateTextFile("C:\Windows\system\vba.txt", True, True)
Fileout.Write "Text"
Fileout.Close
I know I need Administrator rights to do so which I do. Is there a way in VBA to force it to write since the Logged in User has Administrator rights? If so, how can I do it?
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim Fileout As Object
Set Fileout = fso.CreateTextFile("C:\Windows\system\vba.txt", True, True)
Fileout.Write "Text"
Fileout.Close