WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: jtrask on July 26, 2013, 09:37:22 AM

Title: Moving Files/Dirs with aFileMove
Post by: jtrask on July 26, 2013, 09:37:22 AM
I've got an application that for reasons unknown, installs to C:\Program instead of C:\Program Files (C:\Program Files (x86) in my case).  I want my installation script to copy everything from C:\Program to a directory I've created in C:\Program Files (x86).

When I execute
If aFileMove(vstrBadDir:"\*.*",vstrGoodDir:"\*.*",0) == @TRUE Then

it returns false.

When I manually drag and drop to Program Files (x86) I get notified that it will require elevated permissions to perform this unnatural act. Could this be causing an issue for my script even though it is being executed As Administrator?
Title: Re: Moving Files/Dirs with aFileMove
Post by: jtrask on July 26, 2013, 09:52:06 AM
As I am very dimwitted, it took me half a day to realize that I should try to copy these file to somewhere I knew wouldn't require any special permissions like my temp directory.  Surprisingly, that didn't work so I'm back to the drawing board.
Title: Re: Moving Files/Dirs with aFileMove
Post by: Deana on July 26, 2013, 10:54:59 AM
I currently suspect you are dealing with a UAC issue. Program Files (x86) is a protected directory.  The Program Files (x86) directory is not writeable by default for non-administrator accounts. If you are in fact logged as an administrator, you will need to make sure you are running a properly manifested script. In order to get the full administrative privileges you will need to make sure you script is manifested with a RequestedExecutionLevel of HighestAvailable. For more information about UAC and manifest see the Consolidated WIL help file: using the keywords UAC and Manifests.
Title: Re: Moving Files/Dirs with aFileMove
Post by: Deana on July 26, 2013, 12:59:11 PM
I created a tech article that might help when designing script for systems with UAC enabled: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+~+Making~Your~WinBatch~Script~Run~on~Windows~Vista~and~Newer.txt