Jump to content











Photo
- - - - -

FileCopy help??? PLZ!!!!


  • Please log in to reply
26 replies to this topic

#1 Flyboarder

Flyboarder

    Member

  • .script developer
  • 95 posts
  •  
    Canada

Posted 06 June 2009 - 02:07 AM

I can't get this to work,I know that the %WAIK% variable works fine so please dont ask about that.

FileCopy,"#$q%WAIK%\Tools\PETools\x86\winpe.wim#$q",""%basedir%"\Temp\"%ProjectTitle%""

THis just Fails, please help, log file attached....

Attached Files

  • Attached File  log.html   26.48KB   17 downloads


#2 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 06 June 2009 - 04:54 AM

FileCopy,"#$q%WAIK%\Tools\PETools\x86\winpe.wim#$q",""%basedir%"\Temp\"%ProjectTitle%""

THis just Fails, please help, log file attached....

Remove some double quotes, keeping only those surrounding target, like this:

FileCopy,"#$q%WAIK%\Tools\PETools\x86\winpe.wim#$q","%basedir%\Temp\%ProjectTitle%"

#3 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 06 June 2009 - 10:21 AM

Remove some double quotes, keeping only those surrounding target, like this:

Since about WinBuilder 076 you can (and should) omit all quotes, unless there is a written space in a command line.
Logical spaces (resolved from variables) and #$s should not matter.

FileCopy,%WAIK%\Tools\PETools\x86\winpe.wim,%basedir%\Temp\%ProjectTitle%

Peter

#4 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 06 June 2009 - 10:32 AM

....., unless there is a written space in a command line.


Since I guess that a written space is already hard enough to see, I would be curious to see how an unwritten one would look like. ;)

Here is a picture that should be representing it ;):
http://www.boot-land...?...c=3153&st=7

:)

:)

jaclaz

#5 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 06 June 2009 - 11:05 AM

@Jaclaz, I do not understand your concerns.

I 'write' a command line, not by hand, but by pressing some keyboard keys in an order defined by me.
The visual result of the series of key pressing usually makes some sence (at least for a part of WinBuilder users).

When I write a character by pressing the key representing this character, I usually see immediatelly the result : the wanted character.
When I write a space by pressing the 'bar' representing the space, I usually see immediatelly the result : a white space between the last visible character and the cursor.

If that is not a 'written space' what is it?

I disagree that these white spaces are inserted by any random magical actions of my PC, or by Voodoo.

Peter

#6 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 06 June 2009 - 11:45 AM

@psc

I was just kidding. ;)

I see no differences between a written space and an unwritten one, a space is a character (or a keypress) like any other one.

I guess that what you meant (or at least what I am understanding ;)) was (I am using an underscore instead of SPACE on the following examples):

Following NEEDS wrapping quotes:

FileCopy,"%WAIK%\Tools\My_personal_PETools\x86\winpe.wim","%basedir%\my_non_standard_Temp\%ProjectTitle%"


The doubt I am having regarding the space is the following:

Following does not need quotes, IF neither of %WAIK%, %basedir% and %ProjectTitle% expand to something like "My_prog_dir":

FileCopy,%WAIK%\Tools\PETools\x86\winpe.wim,%basedir%\Temp\%ProjectTitle%


or it does NOT need quotes EVEN IF any of %WAIK%, %basedir% and %ProjectTitle% expand to somthing like "My_prog_dir"? :) <- I have understood this one to be the correct answer

Which of the above is correct?

:)

jaclaz

#7 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 06 June 2009 - 12:00 PM

Following does not need quotes, IF neither of %WAIK%, %basedir% and %ProjectTitle% expand to something like "My_prog_dir":
or it does NOT need quotes EVEN IF any of %WAIK%, %basedir% and %ProjectTitle% expand to somthing like "My_prog_dir"? ;) <- I have understood this one to be the correct answer

Yes, the second assumption is correct.
(I hope in all cases. If there are exceptions, it is a bug, and I ask for reporting)

Peter

#8 Flyboarder

Flyboarder

    Member

  • .script developer
  • 95 posts
  •  
    Canada

Posted 06 June 2009 - 05:58 PM

So i found that what i was doing wrong is that %WAIK% is in a different script, can someone give me an actual example of how to use AddVariable as my attempts fail...... a lot......

#9 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 06 June 2009 - 06:03 PM

So i found that what i was doing wrong is that %WAIK% is in a different script, can someone give me an actual example of how to use AddVariable as my attempts fail...... a lot......

Usually %WAIK% should be known through ALL scripts.
Please post here your 'wrong' script (including your unsuccessful AddVariables) that we can see what to do.

And tell us about the project: Name and 'Original or modified'?
If modified, please post the modification(s).

Peter

#10 Flyboarder

Flyboarder

    Member

  • .script developer
  • 95 posts
  •  
    Canada

Posted 06 June 2009 - 06:20 PM

I am starting a win7PE from scratch, my FileCopy will work if the code for %WAIK% is in the same script, I just need to know how to properly use AddVariable so I can call the variables from my previouse script.

the script I want to call from is "004 - WAIK Check.script"

#11 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 06 June 2009 - 07:01 PM

... so I can call the variables from my previouse script.

Please have a look at the board rules, and then tell us what you want to do.

variables from my previouse script

is not a good description for members wanting to help you.
And what is the correlation between 'from scratch' and 'previous script' ????

Peter

#12 Flyboarder

Flyboarder

    Member

  • .script developer
  • 95 posts
  •  
    Canada

Posted 06 June 2009 - 07:07 PM

I have a script called "Base PE.script" that i want to call the %WAIK% variable from "004 - WAIK Check.script"

the code in my WAIK check script is the same as that from win7pe for seting the WAIK path.

AddVariables,%ScriptFile%,Section

the section is Main

but what do i put as the %ScriptFile%????

is it the title of the script I want to call from ir is it the file name with the .script extention?

#13 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 06 June 2009 - 07:17 PM

AddVariables,%ScriptFile%,Section
the section is Main

Appearently you did not look at the board rules, as I suggested in post #11.
So for me the topic is closed, if in your next posts you do not write following the rules.

Maybe you remember this: http://www.boot-land...?...ost&p=51841

Back to your previous post:
That looks very 'impossible' for me.

Theoretically it is possible. But in 9?% the section is 'Variables'

Again:

Tell us more about your issue, not only fragments!

I have a script called "Base PE.script" that i want to call the %WAIK% variable from "004 - WAIK Check.script"

Post the two scripts here!
And make a mark in "Base PE.script" where %WAIK% is used.

Maybe both scripts are 'Standard' anywhere in a project ???, but usually not all members trying to help you, have all scripts available and cannot / do not want to download them.

Peter

#14 Flyboarder

Flyboarder

    Member

  • .script developer
  • 95 posts
  •  
    Canada

Posted 06 June 2009 - 08:01 PM

I have gone through the rules!
ok I will post some code for you;

004 - WAIK Check.script
[codebox] [Process] Echo,"Detecting WAIK/ImageX..." If,ExistFile,"%pFileBox1%\Tools\%SysType%\imagex.exe",Else,Halt,"Fail..." Set,"%WAIK%","%pFileBox1%",ImageX [ImageX] If,ExistFile,"%WAIK%\Tools\%SysType%\imagex.exe",Set,"%IMAGEX%","%WAIK%\Tools\%SysType%\imagex.exe" If,ExistFile,"%WAIK%\Tools\%SysType%\imagex.exe",Set,%ImageTool%,"ImageX" [Interface] pFileBox1="C:\Program Files\Windows AIK",1,13,16,45,200,30,dir[/codebox] Base PE.script [codebox] [Variables] AddVariables,"002#$s-$sWAIK$sCheck",Main [Process] FileCopy,#$q%WAIK%\Tools\PETools\x86\winpe.wim#$q,#$q%BaseDir%\Temp\%ProjectTitle%#$q[/codebox] as i said before i need to call %WAIK% from WAIK Check script to Base PE.script If there is anything else you need please let me know, again im mostly looking for a practical example of how to use AddVariables... As you can see %WAIK% is not set in Base PE.script am i correct in using AddVariables to do this???? Do I need to add a variable section to 004 - WAIK Check.script [codebox] {Variables] %WAIK%=%pFileBox1%
[/codebox]

for this to work?

Sorry for the frustration, trying really hard here!

#15 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 06 June 2009 - 08:17 PM

I'm going to dispair!

I was only asking for two COMPLETE scipts, not for fragments (where you decided what I need ...)

Post the two scripts here!

Today in Germany it is late enough.
So: Maybe I answer tomorrow. That depends on my feeling and my ToDo list ...

Peter

#16 Flyboarder

Flyboarder

    Member

  • .script developer
  • 95 posts
  •  
    Canada

Posted 06 June 2009 - 08:34 PM

I'm going to dispair!

I was only asking for two COMPLETE scipts, not for fragments (where you decided what I need ...)

Today in Germany it is late enough.
So: Maybe I answer tomorrow. That depends on my feeling and my ToDo list ...

Peter


It is only a little fragmented, the only thing the scripts are missing is the [MAIN] section aside from that everything else is there, these are very small scripts.

#17 Flyboarder

Flyboarder

    Member

  • .script developer
  • 95 posts
  •  
    Canada

Posted 06 June 2009 - 08:40 PM

Can you provide a practical example of how to use AddVariables?

Like one that is using a different script to call the variables, I just need to see how it works, and maybe give an explination???

ex. script 'B' calls variable from script 'A'

I am closing the other post as all the replys got off track....

#18 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 06 June 2009 - 08:40 PM

It is only a little fragmented, the only thing the scripts are missing is the [MAIN] section aside from that everything else is there, these are very small scripts.

Sorry, You did not understand!

I cannot help you with the information what is missing!

I need the knowledge about 'what is defined'

I wish you success in finding 'your way'

Bye

peter

#19 Flyboarder

Flyboarder

    Member

  • .script developer
  • 95 posts
  •  
    Canada

Posted 06 June 2009 - 08:48 PM

Here are my scripts:

script A:
[codebox] [Main] Title=002 - WAIK Check Type=script Level=1 Description=Windows Automated Installation Kit (WAIK) is required for this script... Selected=True Version=001 Contact= Date=25.05.09 Locked=True Download_Level=0 Author=ShadowProject Mandatory=False [Process] Echo,"Detecting WAIK/ImageX..." If,ExistFile,"%pFileBox1%\Tools\%SysType%\imagex.exe",Else,Halt,"Fail..." Set,"%WAIK%","%pFileBox1%",ImageX [ImageX] If,ExistFile,"%WAIK%\Tools\%SysType%\imagex.exe",Set,"%IMAGEX%","%WAIK%\Tools\%SysType%\imagex.exe" If,ExistFile,"%WAIK%\Tools\%SysType%\imagex.exe",Set,%ImageTool%,"ImageX" [Interface] pFileBox1="C:\Program Files\Windows AIK",1,13,16,45,200,30,dir [/codebox] script b: [codebox] [Main] Title=007 - Base PE Type=script Level=1 Description=Build Environment Check... Selected=True Version=001 Contact= Date=25.05.09 Locked=True Download_Level=0 Author=ShadowProject Mandatory=True [Variables] AddVariables,"002#$s-$sWAIK$sCheck",Main [Process] FileCopy,#$q%WAIK%\Tools\PETools\x86\winpe.wim#$q,#$q%BaseDir%\Temp\%ProjectTitle%#$q [/codebox] I would like to call %WAIK% from script 'A' to script 'B', so my FileCopy will complete.

#20 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 06 June 2009 - 09:25 PM

I am closing the other post as all the replys got off track....


@Flyboarder

Let's clear this thing.

You DO NOT close posts.

Me Admin, you member. ;)

I moderate, close, merge, move posts/threads, you DO NOT.

Now, psc may be not in one of his best moods today ;), but really you should try your best not to upset him, he is one of the most helpful guys around and definitely knows where his towel is, expecially when it comes to Winbuilder Syntax.
It is really frustrating when someone tries to help and the one who asked for the help posts "bits and pieces" instead of the "whole story".

@psc
remember that everything after Rule #12 is "common sense advice", and, as such, it is not compulsory, just a strongly advised way of speeding things up while making everyone as happy as possible.
If you see that a member is not willing to follow the (best) suggested path, notwithstanding your requests, simply ignore him.
This is just a hobby and a place to relax and have fun, no need to get upset over such trifles.


@BOTH
Rule #12 is on the contrary, a RULE, and one of the MOST IMPORTANT ones:

12. SMILE! :) Life is tough, we all know that, when you enter this board, it will be appreciated that you leave your personal problems behind, asking and replyinq questions or however exchanging informations with a "positive" attitude, TAKE IT EASY :) and enjoy your stay here.


:angry:

jaclaz

#21 Flyboarder

Flyboarder

    Member

  • .script developer
  • 95 posts
  •  
    Canada

Posted 06 June 2009 - 09:43 PM

I apologize to all, maybe if I restate my question It may clear some things up.....

I started my own project, win7pe project to be specific, I am unable to find anywhere on how to start your own project, maybe i have been looking with my eyes closed, but the point is that for my new project iv been walking around in the dark.

My project needs to call variables between scripts but can be altered by the user, since I have found no place where this is described as an api or any other such thing i thought the best way to do this would be by using AddVariables, what I am really looking for is either advice on how to acomplish this in the easiest way or someone explain in detail how to use AddVariables.

I think this post should be moved to a new topic and the current one closed.

#22 Flyboarder

Flyboarder

    Member

  • .script developer
  • 95 posts
  •  
    Canada

Posted 08 June 2009 - 06:49 AM

Hello, again..... I am starting this question from scratch as there was so much confusion, I would like to ask a mod to delete all posts up to this one.....

Question: I have 2 scripts(000.script, test.script) I need to call %WAIK% from 000.script into test.script, how do I do this? Here are my scripts....

000.script
[codebox] [main] Title=Main Configuration Description=Project Configuration... Selected=True Level=1 Version=3 [variables] [process] Set,%WAIK%,%pFileBox1% Message,%WAIK%,CONFIRMATION [Interface] pRadioGroup1="Sys Type:",1,14,21,21,150,62,x86,amd64,0 pTextLabel1="WAIK Path:",1,1,265,23,230,18,8,Normal pFileBox1="C:\Program Files\Windows AIK",1,13,257,40,200,50,dir
[/codebox]

test.script
[codebox]
[main]
Title=Test Script
Description=Test Script...
Selected=True
Level=1
Version=3

[variables]

[process]

AddVariables,%&#48;&#48;0%,process

Message,"%WAIK%",CONFIRMATION
[/codebox]

#23 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 08 June 2009 - 07:24 AM

ok, Flyboarder!
This post finally explains your real intention! ;)

I think your questions are answered in the help:
http://winbuilder.ne..._variables.html
http://winbuilder.ne...ml#AddVariables

If that is not clear enough, let me know. Then I'll try to correct the help.

Here a short overview:

Generally to AddVariable:
In script1 you have a section [Variables] defining the variables which are used in script1:

&#91;Variables&#93;

%myVar%=BlaBla

%yourVar%=Hello
To make clear: These are definitions. If the script changes the values, that will not appear in the [Variables] section.

Script2 has a similar construction with it's own definitions.

Now script2 executes the statement
AddVariables,<path to script1>,Variables
That copies the Variables section's definitions of script1 into the variables space of script2, as if they would have been defined in [Variables] of script2.

Eventually different actual values in script1 are not seen!

If you want to have an actual value of e.g. %WAIK% which is set in script1:

Since WinBuilder 077 beta 1 you have this possibility;

Use in script1
Set,%WAIK%,%pFileBox1%,GLOBAL
This will make %WAIK% available for all following scripts in the current build.
%WAIK% will be undefined e.g. if you click a button in a script, which processes something.

Or use in script1
Set,%WAIK%,%pFileBox1%,PERMANENT
This will write %WAIK% into scripts.project and therefore be available allways.
%WAIK% will be known e.g. if you click a button in a script, which processes something.


Older WinBuilder versions can write into script.project with
IniWrite,&#34;%ProjectDir%\script.project&#34;,&#34;Variables&#34;,&#34;#$pWAIK#$p&#34;,&#34;%pFileBox1%&#34;

Please see the difference of 'old' and 'new' due to quotes!

Peter

#24 Flyboarder

Flyboarder

    Member

  • .script developer
  • 95 posts
  •  
    Canada

Posted 08 June 2009 - 10:23 PM

Wow that was an amazing explination, I can't wait to start trying this when I get into work.

Am i correct to assume that the help files are out of date as they do not have this information? or is there a seperate help section for more advanced scripting?

#25 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 09 June 2009 - 06:55 AM

Am i correct to assume that the help files are out of date as they do not have this information?

You are partly correct! ;)

The help files contain most of this information, but maybe a bit hidden ...

Peter




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users