aFileCopy problem

Started by Roman Pruszkowski, May 29, 2015, 12:24:08 PM

Previous topic - Next topic

Roman Pruszkowski

Hello,

I have a problem with calling aFileCopy function in one of our installation scripts.
In the code, the call looks like this:

aFileCopy("%CurrentDir%Sentinel\Bin\SentinelDB.ini","%SENTDIRC%",1024)

SENTDIRC variable is initialized earlier in the program like this:

SENTDIRC=("C:\Sentinel\Bin")
The idea is to copy file from one location to another, obviously :)

The code compiles fine but then I get the error message at runtime:

"Uninitialized variable, undefined function, or unquoted string".
The source and destination paths look correct in the message and the file that needs to be copied is present in the source directory.

I run WinBatch 2015A.
Any help will be appreciated.

Thank you,

Roman

td

The 'aFileCopy' function is not a WIL function.  It is a shell operations extender function.  So you need to load the shell operations extender using the AddExtender function.  Of course you also need to download the extender and make sure your compiled script has access to it by including it in the compiled script or placing it where the exe can find it.

Out of curiosity, why did you place your string in parenthesizes?  It really doesn't hurt anything other than waste a few CPU cycles but it doesn't really help much either.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Roman Pruszkowski

Thank you!
AddExtender("wwsop34i.DLL") call was present in the code but the dll itself was missing from the folder where I put the exe file. Now it is working fine, phew!
Btw, I am completely new to WinBatch and I am modifying a few ancient (10 years old) install and launch scripts that were written by somebody else. Therefore, I am not really in the position to question this code :)

td

Questioning the code and hopefully finding an answer is one way to learn WIL (WinBatch.)
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade