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
smopuiM

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 Win7 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
Ztruker

Windows 10 Pro 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
CyberZeus

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
smopuiM

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
Ztruker

Windows 10 Pro 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
smopuiM

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 Win7 64 machine (see OP.)

Any guesses as to why this particular Win7 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
Ztruker

Windows 10 Pro 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
smopuiM

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 Win7 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





Similar help and support threads
Thread Forum
Program to monitor folder and rename files?
Hi All, i'm looking for a way to auto rename files with a pre defined prefix and consecutive numbers when they are moved into a folder. I have tried a program called personal rename, I can get the rename function to work but the folder monitoring is giving me issues, not sure if it doesn't work the...
Software
Program installed in Program Files requires elevation?
I have a program that wanted to install in a document folder :mad: I have installed it in Program Files, but it requires elevation or it produces errors when running. I know I can tick the Run As ... box in the shortcut, but is there a better way, such as taking ownership of the install folder?
System Security
Can't run installed program within Program Files (x86)
Am not sure if this is the right place to ask for this problem, let me know. I gave a try to the Setup Project of VStudio 2008 to create and distribute an x86 installer of a program I develop in win7. After installing, uninstalling and executing over and over some of the features of my...
Software
Program Files (x86) & Program Files Installed On Another Drive
Hi have have a new PC running Win7 Home Premium 64bit. I have 2 drives: 1 x 120GB SSD (running the OS) (C Drive) 1 x 1TB HDD (D Drive) The SSD is running the OS and a couple of main programs which i use quite often (ie. Office 2010, Antivirus, etc). The HDD i want to use to install and...
General Discussion
Programs installed in E:\\Program Files run as x32
Hello there, everybody! Half a year ago my laptop's hard disk's clusters began to fail, so I finally had to change it with a Western Digital Scorpio Black 750 GB - 7200rpm (WD7500BPKT). When reinstalling Windows 7 Home Premium x64, I decided to dedicate the C:\\ unit to the OS "only", and E:\\ to...
Software
Program Files or Program Files (x86)-Where to place downloaded program
My computers are both running Win 7 64-bit. I am thoroughly confused when it comes to placing programs that I download into their proper folders: That is, program files (x86) vs program files. I have read stuff on this, but still confused. for the most part, even when a dl'd program suggests...
Software

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 05:50.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App