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


  1. Posts : 7
    Win7 64
       #1

    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 Computer


  2. Posts : 6,285
    Windows 10 Pro X64
       #2

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


  3. Posts : 313
    Windows 7 Ultimate x64 SP1 clean install
       #3

    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


  4. Posts : 7
    Win7 64
    Thread Starter
       #4

    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


  5. Posts : 6,285
    Windows 10 Pro X64
       #5

    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


  6. Posts : 7
    Win7 64
    Thread Starter
       #6

    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


  7. Posts : 6,285
    Windows 10 Pro X64
       #7

    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


  8. Posts : 7
    Win7 64
    Thread Starter
       #8

    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


 

  Related Discussions
Our Sites
Site Links
About 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 03:18.
Find Us