|
-
Oct 19th, 2010, 04:08 AM
#1
Thread Starter
Fanatic Member
Win7 and vista permission problems
Hello guys,
I recently developed an app in vb6 that has to modify some system file for it to function properly eg host.
Even when running in in admin user account, "not the default administrator", permission to that file is locked or the file is readonly.
Unless the program is run in the default administrator account, then the file is locked. teh program works well in winxp, except vista and win7
what do i do now, as i need a way to add dns record to the host file without running as administrator account
-
Oct 19th, 2010, 06:36 AM
#2
New Member
Re: Win7 and vista permission problems
In Vista and Win 7 you have to run as "Administrator" by right clicking your application and selecting to run as "Administrator". Though if the user is mentioned as the "Administrator" it is not so. And moreover no vb6 application will run on win7 and vista. Better always use WinXP.
-
Oct 19th, 2010, 08:44 AM
#3
Re: Win7 and vista permission problems
The first half of that reply is correct, but I'm afraid that this part is very wrong:
 Originally Posted by [email protected]
And moreover no vb6 application will run on win7 and vista. Better always use WinXP.
In most cases VB6 applications work perfectly on Vista/7 with no changes at all, or just the same changes needed for XP and 2000 to allow non-admin users to be able to run them (such as this particular issue).
In fact generally Vista/7 require fewer code changes than XP/2000 for a non-admin, due to features such as virtualisation automatically fixing your mistakes to some degree.
-
Oct 19th, 2010, 11:47 PM
#4
New Member
Re: Win7 and vista permission problems
Oops sorry i had used a wrong word saying that the VB6 application wont work in win7 and vista.
What i had meant is if any code has to be done using vb6 in win7 and vista, it is not so easily possible.
This is what i tried to mean.
Sorry for my wordings.
Thanks for pointing it out.
-
Oct 21st, 2010, 11:07 AM
#5
Thread Starter
Fanatic Member
Re: Win7 and vista permission problems
thanks for response
instead of rightclicking, is there a way to force the app to require administrator privileged before starting?
The app is installed and run under admin account
Last edited by coolcurrent4u; Oct 21st, 2010 at 11:11 AM.
-
Oct 21st, 2010, 11:21 AM
#6
Re: Win7 and vista permission problems
You can manifest it to do that. It has been asked before, try doing a few Searches on the forum.
-
Oct 21st, 2010, 10:22 PM
#7
Thread Starter
Fanatic Member
Re: Win7 and vista permission problems
i found some code that requires attaching manifest to my app.
vb Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="MyApp" type="win32"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
I have not tested it yet, but in case it works, the problem is that i already manifest for xp styles. is there a way i cam merge the two manifest, or i only need to change some parameters
optionally, where can i get detailed information about manifest and vb
-
Oct 25th, 2010, 08:12 AM
#8
Re: Win7 and vista permission problems
Manifest files are not specific to VB (there is no link at all) but to executables, you can find info about manifest files at Microsoft.
You can merge multiple files together. I'm not sure of the details, but it should be easy to work out... I suspect you just need to copy the security section to the other file.
-
Oct 26th, 2010, 09:25 AM
#9
Thread Starter
Fanatic Member
Re: Win7 and vista permission problems
Thanks Si,
I'll try it out
-
Oct 26th, 2010, 12:33 PM
#10
Re: Win7 and vista permission problems
It isn't a question of "merging files together."
An application manifest is an XML document that can provide lots of information about your application to Windows. Just copy/pasting things into your manifest can have effects you don't expect if you don't understand what you're doing.
For example the presence of a trustInfo section tells Windows your program is "Vista aware" which will bypass many 9x/XP AppCompat shims. This can cause your program to fail in unexpected ways if it isn't actually aware of the rules of the road.
-
Oct 27th, 2010, 05:17 AM
#11
Re: Win7 and vista permission problems
la volp has posted an app (source) to add manifests to your project res file, for both xp styles and admin elevation
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
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
|