Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Administration > Full Control to Users programmatically

Reply
Thread Tools Display Modes

Full Control to Users programmatically

 
 
vovan
Guest
Posts: n/a

 
      02-10-2007
My VB6 program is installed by setup created in InstallShield 12.
Before Vista everything was working fine.
On Vista one of the operations (replace file located in c:\program files\my
program with another file) fails - my research showed me than there is an
error 70, 'Access denied'
After I set manually Full Control to Users of that machine everything works
fine.
Any advice how to set Full Control to Users programmatically from VB6 or
from InstallShield project.

Thank you
Vovan


 
Reply With Quote
 
 
 
 
Jack
Guest
Posts: n/a

 
      02-10-2007
I guess you need to change the design.
Do not use c:\program files folder.

"vovan" <> wrote in message
news:...
> My VB6 program is installed by setup created in InstallShield 12.
> Before Vista everything was working fine.
> On Vista one of the operations (replace file located in c:\program
> files\my program with another file) fails - my research showed me than
> there is an error 70, 'Access denied'
> After I set manually Full Control to Users of that machine everything
> works fine.
> Any advice how to set Full Control to Users programmatically from VB6 or
> from InstallShield project.
>
> Thank you
> Vovan
>



 
Reply With Quote
 
vovan
Guest
Posts: n/a

 
      02-10-2007
Most programs (at least before Vista) use this design.
There should be some other solution not related to change the design, I
hope.
Thanks

Vovan

"Jack" <replyto@it> wrote in message
news:...
>I guess you need to change the design.
> Do not use c:\program files folder.
>
> "vovan" <> wrote in message
> news:...
>> My VB6 program is installed by setup created in InstallShield 12.
>> Before Vista everything was working fine.
>> On Vista one of the operations (replace file located in c:\program
>> files\my program with another file) fails - my research showed me than
>> there is an error 70, 'Access denied'
>> After I set manually Full Control to Users of that machine everything
>> works fine.
>> Any advice how to set Full Control to Users programmatically from VB6 or
>> from InstallShield project.
>>
>> Thank you
>> Vovan
>>

>
>



 
Reply With Quote
 
Jimmy Brush
Guest
Posts: n/a

 
      02-10-2007
Two things you are doing wrong here:

1) Your program can only modify Program Files during install time, from a
Windows Service, a privileged scheduled task, of if your program prompts the
user for administrator permission.

If this is part of the "setup" process for your app, it needs to be
implemented as a custom action in the setup program (marked as do not
impersonate).

Otherwise, as Jack suggested, there is probably a better way to do what you
need to do.

In Windows Vista, only programs that ask the user for admin permission can
perform administrative tasks, such as modifying files in Program Files.

Programs that do not have admin permission can only save files to the
personal folders associated with the user (such as their documents folder),
or folders set aside by the system for application storage.

2) DO NOT CHANGE SECURITY SETTINGS ON SYSTEM FILES PROGRAMATICALLY. *EVER*.



--
- JB
Microsoft MVP - Windows Shell/User

Windows Vista Support Faq
http://www.jimmah.com/vista/

 
Reply With Quote
 
vovan
Guest
Posts: n/a

 
      02-10-2007
I need a full control for Users on "C:\Program Files\My Program" folder.
I had it for more than 10 years with no problem (before Vista). What's wrong
with my wish now?
It looks like you lived your live with 2 legs, you drove many cars. Now
somebody created a new kind of car requirening you to have 3 legs. And they
say that it's much better for you not allowing you to have any choice. They
are going to replace all existing models with new ones.
I found some way (using Windows script) to give Users full control on
"C:\Program Files\My Program", not on entire "C:\Program Files\". Just on my
folder.
It looks like adjustment will take much less time than full redesign.
What is wrong with this approach?

Thank you
Vovan

"vovan" <> wrote in message
news:...
> My VB6 program is installed by setup created in InstallShield 12.
> Before Vista everything was working fine.
> On Vista one of the operations (replace file located in c:\program
> files\my program with another file) fails - my research showed me than
> there is an error 70, 'Access denied'
> After I set manually Full Control to Users of that machine everything
> works fine.
> Any advice how to set Full Control to Users programmatically from VB6 or
> from InstallShield project.
>
> Thank you
> Vovan
>



 
Reply With Quote
 
Jimmy Brush
Guest
Posts: n/a

 
      02-10-2007
It destroys the built-in security provided by Windows.

Changing this security setting allows ANY PROGRAM ran by ANY USER to modify
your program's files. This is unacceptable - Program Files is only to be
modified by administrators.

If you want to do this on your computer - hey, that's your choice, go right
ahead.

But you CANNOT make this choice for the users of your program - you will
weaken the security of their system, without their consent, as a result of
your actions.

You must follow the programming guidelines enforced by Microsoft on behalf
of all the users of their operating system.

--
- JB
Microsoft MVP - Windows Shell/User

Windows Vista Support Faq
http://www.jimmah.com/vista/

"vovan" <> wrote in message
news:...
>I need a full control for Users on "C:\Program Files\My Program" folder.
> I had it for more than 10 years with no problem (before Vista). What's
> wrong with my wish now?
> It looks like you lived your live with 2 legs, you drove many cars. Now
> somebody created a new kind of car requirening you to have 3 legs. And
> they say that it's much better for you not allowing you to have any
> choice. They are going to replace all existing models with new ones.
> I found some way (using Windows script) to give Users full control on
> "C:\Program Files\My Program", not on entire "C:\Program Files\". Just on
> my folder.
> It looks like adjustment will take much less time than full redesign.
> What is wrong with this approach?
>
> Thank you
> Vovan
>
> "vovan" <> wrote in message
> news:...
>> My VB6 program is installed by setup created in InstallShield 12.
>> Before Vista everything was working fine.
>> On Vista one of the operations (replace file located in c:\program
>> files\my program with another file) fails - my research showed me than
>> there is an error 70, 'Access denied'
>> After I set manually Full Control to Users of that machine everything
>> works fine.
>> Any advice how to set Full Control to Users programmatically from VB6 or
>> from InstallShield project.
>>
>> Thank you
>> Vovan
>>

>
>


 
Reply With Quote
 
mayayana
Guest
Posts: n/a

 
      02-10-2007

> I found some way (using Windows script) to give Users full control on
> "C:\Program Files\My Program", not on entire "C:\Program Files\". Just on

my
> folder.
> It looks like adjustment will take much less time than full redesign.
> What is wrong with this approach?


That sounds like a good idea to me.
How do you achieve that?

(My best idea for a solution so far is a note saying
something like: "If you have the misfortune to be using
Windows Vista, and you want to use this software,
then you will need to give yourself permission to
fully use your PC."


 
Reply With Quote
 
vovan
Guest
Posts: n/a

 
      02-10-2007
I created a function:
Public Function SetUsersPermission(strFolder As String) As Integer
'Call this function when a new folder is created in Coordinator Folder
'to give a Full Access to Users
Dim objShell As Object
Dim intRunError As Integer
On Error Resume Next
intRunError = 1 'in case of error that value will be returned
Set objShell = CreateObject("Wscript.Shell")
'objShell.Run returns 0 if success
intRunError = objShell.Run("cmd /c cacls " & strFolder & " /e /g
Users:F", 0)
SetUsersPermission = intRunError
End Function

I call it every time I'm creating a new folder which is going to be accessed
by my program to save there some file.

Vovan

"mayayana" <> wrote in message
news:Zzmzh.22883$ hlink.net...
>
>> I found some way (using Windows script) to give Users full control on
>> "C:\Program Files\My Program", not on entire "C:\Program Files\". Just on

> my
>> folder.
>> It looks like adjustment will take much less time than full redesign.
>> What is wrong with this approach?

>
> That sounds like a good idea to me.
> How do you achieve that?
>
> (My best idea for a solution so far is a note saying
> something like: "If you have the misfortune to be using
> Windows Vista, and you want to use this software,
> then you will need to give yourself permission to
> fully use your PC."
>
>



 
Reply With Quote
 
Kerry Brown
Guest
Posts: n/a

 
      02-10-2007
Why would you want to risk doing this? What will happen when some user finds
out you modified their system needlessly and lowered their security. It is
their computer not yours. Are you so arrogant that you think your program
can do whatever it wants to someone else's computer or are you just too lazy
to lean how to do things properly? You will potentially alienate your
customers at best and possibly set yourself up for a lawsuit at worst. Vista
is here. Learn to program for it.

--
Kerry Brown
Microsoft MVP - Shell/User
http://www.vistahelp.ca


"vovan" <> wrote in message
news:...
>I created a function:
> Public Function SetUsersPermission(strFolder As String) As Integer
> 'Call this function when a new folder is created in Coordinator Folder
> 'to give a Full Access to Users
> Dim objShell As Object
> Dim intRunError As Integer
> On Error Resume Next
> intRunError = 1 'in case of error that value will be returned
> Set objShell = CreateObject("Wscript.Shell")
> 'objShell.Run returns 0 if success
> intRunError = objShell.Run("cmd /c cacls " & strFolder & " /e /g
> Users:F", 0)
> SetUsersPermission = intRunError
> End Function
>
> I call it every time I'm creating a new folder which is going to be
> accessed by my program to save there some file.
>
> Vovan
>
> "mayayana" <> wrote in message
> news:Zzmzh.22883$ hlink.net...
>>
>>> I found some way (using Windows script) to give Users full control on
>>> "C:\Program Files\My Program", not on entire "C:\Program Files\". Just
>>> on

>> my
>>> folder.
>>> It looks like adjustment will take much less time than full redesign.
>>> What is wrong with this approach?

>>
>> That sounds like a good idea to me.
>> How do you achieve that?
>>
>> (My best idea for a solution so far is a note saying
>> something like: "If you have the misfortune to be using
>> Windows Vista, and you want to use this software,
>> then you will need to give yourself permission to
>> fully use your PC."
>>
>>

>
>


 
Reply With Quote
 
vovan
Guest
Posts: n/a

 
      02-10-2007
I'm doing it for the folder with my program. What is wrong with this? I said
I do not give permission to the entire Program Files folder.
What is the difference if I move my program to different location and will
allow to access its folders there?
What about a lawsuit for such companies like Adobe with their Photoshop,
which stores temp files in its folder. I did not test it on Vista yet, but I
think there might be some problems with permission too.

I'm looking for the fastest way to adopt my program to Vista for now. Later
I will think about the need to redisign it.
Now my clients are going to by new machines with Vista. I tested my program
on it and many features do not work. So, what is the best way from your
point of view to give them the ability to use my program on Vista. Ask them
to wait until I redesign everything?
I also woud ask if there is anybody else as stupid as me who did not have
any problem with security before, but with Vista has them. Or it's just me?
Everybody else knew all the time that it's a bad idea to install his (her )
program in Program Files folder. Everybody always knew that it's a bad idea
to store temporary files in its program folder. Everybody always knew that
Microsoft is going to change their security phylosophy. Only I did not know
anything.

Thank you

Vovan

"Kerry Brown" <*a*m> wrote in message
news:...
> Why would you want to risk doing this? What will happen when some user
> finds out you modified their system needlessly and lowered their security.
> It is their computer not yours. Are you so arrogant that you think your
> program can do whatever it wants to someone else's computer or are you
> just too lazy to lean how to do things properly? You will potentially
> alienate your customers at best and possibly set yourself up for a lawsuit
> at worst. Vista is here. Learn to program for it.
>
> --
> Kerry Brown
> Microsoft MVP - Shell/User
> http://www.vistahelp.ca
>
>
> "vovan" <> wrote in message
> news:...
>>I created a function:
>> Public Function SetUsersPermission(strFolder As String) As Integer
>> 'Call this function when a new folder is created in Coordinator Folder
>> 'to give a Full Access to Users
>> Dim objShell As Object
>> Dim intRunError As Integer
>> On Error Resume Next
>> intRunError = 1 'in case of error that value will be returned
>> Set objShell = CreateObject("Wscript.Shell")
>> 'objShell.Run returns 0 if success
>> intRunError = objShell.Run("cmd /c cacls " & strFolder & " /e /g
>> Users:F", 0)
>> SetUsersPermission = intRunError
>> End Function
>>
>> I call it every time I'm creating a new folder which is going to be
>> accessed by my program to save there some file.
>>
>> Vovan
>>
>> "mayayana" <> wrote in message
>> news:Zzmzh.22883$ hlink.net...
>>>
>>>> I found some way (using Windows script) to give Users full control on
>>>> "C:\Program Files\My Program", not on entire "C:\Program Files\". Just
>>>> on
>>> my
>>>> folder.
>>>> It looks like adjustment will take much less time than full redesign.
>>>> What is wrong with this approach?
>>>
>>> That sounds like a good idea to me.
>>> How do you achieve that?
>>>
>>> (My best idea for a solution so far is a note saying
>>> something like: "If you have the misfortune to be using
>>> Windows Vista, and you want to use this software,
>>> then you will need to give yourself permission to
>>> fully use your PC."
>>>
>>>

>>
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing folder on desktop shares 'c:\users' everybody full access? Mr.Nobody Windows Vista Networking 2 04-05-2008 01:17 AM
how to take full control over pc in vista? Neerav Windows Vista General Discussion 14 01-13-2008 02:22 PM
Full Control to Users programmatically vovan Windows Vista General Discussion 55 05-25-2007 07:54 PM
Full Control to Users programmatically vovan Windows Vista Networking 55 05-25-2007 07:54 PM
I want FULL CONTROL NOW!!! amenx Windows Vista General Discussion 41 05-05-2007 01:08 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59