In Windows, I defined the environment variable as such
variable name = hook
variable value = c:\service\partition
Then, I put a txt file (ie, test.txt) under c:\service\partition directory
I opened a dos prompt and typed "copy %hook%\test.txt c:\" and this command would copy the test.txt to the C:\ drive
can I do the same in Winbatch??
In another words, if I write
filecopy(%hook%\test.txt, c:\, @FALSE) ; would this command copy the test.txt file onto the C:\ drive??
thanks
You have to retrieve the value from the environment.
Hook = environment("hook")
then your sample code would work.
Be aware that substitution has a limit as to the size of string it can handle, 2048, I think. Lots of lovely traps waiting but you should check out substitution, you can do things that are nearly impossible to do without it. WinBatch wouldn't be WinBatch without it IMHO.
Thank you, George. That work.