-
October 16th, 2012, 03:42 PM
#1
How to copy file with Administrator's right
Hello everybody ,
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
Please help me. Thanks a lot
-
October 16th, 2012, 05:36 PM
#2
Re: How to copy file with Administrator's right
Can't get around ADMINISTRATOR permissions, since Windows 95. Each version gets harder, and you didn't mention your OS.
-
October 17th, 2012, 03:01 AM
#3
Re: How to copy file with Administrator's right
Thanks Sir ,
I'm using Windows 7
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 ?
Thanks for your tutorial.
-
October 17th, 2012, 06:11 AM
#4
Re: How to copy file with Administrator's right
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.
-
October 17th, 2012, 12:24 PM
#5
Re: How to copy file with Administrator's right
Because it calls the TRUSTED INSTALLER Service. This is the ONLY way to install in a private Windows folder. You cannot write to some areas. Period.
-
October 18th, 2012, 05:18 AM
#6
Re: How to copy file with Administrator's right
Originally Posted by dglienna
You cannot write to some areas
He do not need to do this: write some area, just change settings of trusted instaler or do nothing and jus run programs as administrator.
-
October 19th, 2012, 12:33 PM
#7
Re: How to copy file with Administrator's right
Care to tell anyone HOW to "just change settings of trusted installer". Do nothing sounds better.
-
October 20th, 2012, 10:56 AM
#8
Re: How to copy file with Administrator's right
Originally Posted by dglienna
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:
http://www.youtube.com/watch?v=y9TOWxZGbJc
Last edited by Halosar7; October 20th, 2012 at 11:02 AM.
-
October 20th, 2012, 01:01 PM
#9
Re: How to copy file with Administrator's right
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.
-
October 22nd, 2012, 02:09 AM
#10
Re: How to copy file with Administrator's right
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...
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
November 15th, 2012, 08:14 AM
#11
Re: How to copy file with Administrator's right
Hi! As one of the options I can advise to use virtualization. For example, it can be boxedapp or thinapp.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|