Author Topic: Moving Files/Dirs with aFileMove  (Read 2964 times)

jtrask

  • Jr. Member
  • **
  • Posts: 71
Moving Files/Dirs with aFileMove
« 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
Code: [Select]
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?

jtrask

  • Jr. Member
  • **
  • Posts: 71
Re: Moving Files/Dirs with aFileMove
« Reply #1 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.

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Moving Files/Dirs with aFileMove
« Reply #2 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.
Deana F.
Technical Support
Wilson WindowWare Inc.

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Moving Files/Dirs with aFileMove
« Reply #3 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
Deana F.
Technical Support
Wilson WindowWare Inc.