When I write VB6 program , I need to copy files to C:\Windows. But always fail as I don't have Administrator's Right. I found a program on web but also fail :
Option Explicit
Private Sub Command1_Click()
Const ssfDESKTOP = 0
Const ssfWINDOWS = 36
Dim OriginalFile As String
Dim CopiedFile As String
Dim F As Integer
With CreateObject("Shell.Application")
With .NameSpace(ssfDESKTOP).Self
OriginalFile = .Path & "\test-orig.txt"
End With
With .NameSpace(ssfWINDOWS).Self
CopiedFile = .Path & "\test-copy.txt"
End With
End With
F = FreeFile(0)
Open OriginalFile For Output As #F
Print #F, "Testing!"
Close #F
DoEvents
FileCopy OriginalFile, CopiedFile
Kill OriginalFile
MsgBox FileLen(CopiedFile)
End Sub
Even when I install Adobe Photoshop 5.0 , still file and Adobe folder can be installed and copied in program files. Such an old software still can write stuffs in Program Files and some dll in C:\Windows\System32 , but why can we write files in C:\Windows via VB6 ?
Vb6 instalation RUN AS ADMINISTRATOR. Just right click on vb6.exe file, then choose (run as administrator)
All your programs run as administrator. Of course you just can change folders rights from admin to other.
Care to tell anyone HOW to "just change settings of trusted installer". Do nothing sounds better.
I agree. Better not change settings if you dont know what to do. Just run soft as admin. Who wants to change settings of trusted installer can find info in internet. See in this video how to change settings and gain full control:
Try that on any WINDOWS or PROGRAM folder and see what happens when you try to INSTALL ANOTHER APP. No way to reverse the process other than clean install.
I think you should look up 'Elevated Rights'.... (this essentially, Asks the Windows UAC for permition, and the UAC will grant according to settings and user response...
Bookmarks