Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Allow installed program to rename files under Program Files (x86)

18 Jun 2012   #1

Win7 64
 
 
Allow installed program to rename files under Program Files (x86)

Hi,
I have a program installed under "C:\Program Files (x86)\CompanyName\SWName".
When the program runs it's supposed to copy some files, say
FROM
"C:\Program Files (x86)\CompanyName\SWName\Drivers\*.abc
TO
"C:\Program Files (x86)\CompanyName\SWName\Drivers\*.xyz

The program works on every machine it's been installed on, except for one (customer's) Win 7 64-bit machine. On that machine, nothing happens.

It's noteworthy that on that same machine an "insufficient access privileges" (or some such) message pops-up when an administrator trys to copy a folder to "C:\Program Files (x86)\CompanyName\NewName".

Any guesses as to why this particular Windows 7 machine is being so picky? What should I have the installer do so that the application will be able to copy/rename its own files?

Thanks/Cheers.


My System SpecsSystem Spec
.

18 Jun 2012   #2

Windows 8 Core X64
 
 

Try right clicking on the program installer and select Run as Administrator. See if that allows it to complete.
My System SpecsSystem Spec
19 Jun 2012   #3

Windows 7 Ultimate x64 SP1 clean install
 
 

Hi and welcome to Seven Forums!

As a developer, I suggest you that applications don't have to write directly on %ProgramFiles% or %ProgramFiles(x86)%.
You should consider %AppData%.

CyberZeus
My System SpecsSystem Spec
.


19 Jun 2012   #4

Win7 64
 
 

Hi Thanks for the replys.
Ztruker, The problem isn't with the installer. The problem is lack of program privileges - or excessive security - post-install. The program isn't allowed to rename some files.

CyberZeus, The files being renamed are not data files, they're "plug-ins" required by the application. They could be renamed once, during install, but for reasons related to development it's convenient to have them renamed on every startup.

Has anyone here used [the "DOS" command] ICACLS? Can it be used to tweak the "Driver" folder permissions so the application can rename the files?

Any help is appreciated!
My System SpecsSystem Spec
19 Jun 2012   #5

Windows 8 Core X64
 
 

If the user is an Administrator account, then you should be able to give the Administrators group as much access authority as you want.

Right click on C:\Program Files (x86)\CompanyName\SWName and select Properties. Click on the Security tab then click on the Advanced button. Click the Change Permissions button. Pick the appropriate name then click on Edit. Set the Allow selections you need, probably Full Control. Apply and OK as needed to close all windows.

See if that works.

If you don't have a Security tab then you need to do two things:

1. Enable hidden Administrator account from an Elevated Command Prompt: net user Administrator active:yes
2. Boot to Safe Mode, login as Administrator then make the permission changes.
My System SpecsSystem Spec
19 Jun 2012   #6

Win7 64
 
 

Hi Ztrucker,
First, thank you for the help! Your advice is a little off target because I misled you with "Hi, I have a program installed..."

Actually, I wrote the program and the installer, and my goal is to fix the installer so that the installed program is able to rename some files. This file renaming hasn't been a problem until encountering one particular Windows 7 64 machine (see OP.)

Any guesses as to why this particular Windows 7 machine is being so picky? What should I have the installer do so that the application will be able to copy/rename its own files?

NOTE: During installation, the installer runs a .bat file which copies device drivers and DLLs to various folders inder C:\Windows. This same .bat could configure the installation directory - or, better, just the \Drivers sub-directory - so that the program will be able to rename some files.

Thanks/Cheers!
My System SpecsSystem Spec
19 Jun 2012   #7

Windows 8 Core X64
 
 

Maybe you can run the takeown.exe command from your batch file?

Enter takeown /? from a command prompt to see the syntax.

Will be something like:

takeown /f "C:\Program Files (x86)\CompanyName\SWName" /A


If that is not recognized, you will have to fully qualify the command:

C:\Windows\System32\takeown.exe /f "C:\Program Files (x86)\CompanyName\SWName" /A
My System SpecsSystem Spec
20 Jun 2012   #8

Win7 64
 
 

Hi Ztruker,
Thanks - I'll try that when I have a chance to work on the problem machine (using a remote-control program). Part of the difficulty solving this is that I haven't been able to reproduce the problem locally. I borrowed a fresh Windows 7 64 laptop from IT, but it doesn't exhibit the "pickyness" that the customer's machine does.

The customer is at a university and I'm suspecting their IT configures the machines with tighter-than-normal security. Like it said in OP, a user with admin priviliges can't even drag/drop a folder into Program Files (x86)!

Will try suggestion,
Thanks again!
My System SpecsSystem Spec
Reply

 Allow installed program to rename files under Program Files (x86)




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 11:19 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

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