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

smopuiM

New member
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 Computer

OS
Win7 64
Try right clicking on the program installer and select Run as Administrator. See if that allows it to complete.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
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 Computer

Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1 clean install
CPU
AMD Athlon 64 X2 6400+
Motherboard
Asus M2N-E SLI
Memory
4 GB
Graphics Card(s)
2 x NVidia Geforce 8600 GTS
Sound Card
Trust 5.1 Surround USB
Monitor(s) Displays
Benq FP931 19"
Screen Resolution
1280x1024@32bit@75MHz
Hard Drives
1 x Western Digital 500GB SATA (OS installation), 2 x Seagate 320GB SATA, 1 x Seagate 250GB IDE (in external USB box), 1 x TrekStor 750GB USB
PSU
650W
Keyboard
Logitech Cordless Desktop EX 100
Mouse
Logitech Cordless Optical
Internet Speed
8192 kbps / 640 kbps
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 Computer

OS
Win7 64
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
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 Computer

OS
Win7 64
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
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 Computer

OS
Win7 64
Back
Top