topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 5:54 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - wolf.b [ switch to compact view ]

Pages: [1] 2 3next
1
I have a gmail account and checked the first time for mail about 2 1/2 years after opening, and it still worked.


greetings


Wolf

2
Hi Jim,

thanks for the hints. My response is quite likely much too late, but I wasn't around for a while.

I have tried the environment variable %CD% that you mentioned in a batch file like this:

::TEST.BAT

echo %CD%

The output this batch file creates when called from within the directory where it is stored is as expected:

C:\Users\Wolf\>test.bat
C:\Users\Wolf

and the output when called from from the root directory is this:

C:\>Users\Wolf\test.bat
C:\

I noticed that the variable is inconsistent in adding a trailing backslash as the the ending character.



CopyMyFiles.cmd is stored in C:\Scripts
At the command prompt, you change directories to F:\Data
From there you type in the command
       C:\Scripts\CopyMyFiles.cmd
The %CD% variable will contain the value F:\Data.

I agree with everything you say, but would you not get the same behaviour when omitting the %CD%\ from your suggested CopyMyFiles.cmd?

copy data.exe c:\windows\system32\data
copy pic.jpg C:\Documents and Settings\Administrator\Desktop


I might have misunderstood the original question, but it seems to me that the question was to find a way to refer to the directory where the batch file is located (USB device?), rather than storing the batch on the hard drive.


Friendly

Wolf

3
Developer's Corner / Re: A little help with an AHK web-browser?
« on: November 22, 2007, 01:39 AM »
Hi wreckedcarzz,

the author (Sean) said something about IEControl.ahk here:

I uploaded the standard library IE.ahk, which can be downloaded from the first post in this thread.
I'll discontinue the support of the old IEControl.ahk, so updated COM.ahk accordingly to be used with IE.ahk.

The mentioned download link is in the first post.



Problem #2: URL bar does not work. I have had success with it, after I removed the quotation marks from this line:

IE_LoadURL(pwb, "AddressBar")

like so:

Go:
Gui, Submit, NoHide
IE_LoadURL(pwb, AddressBar)
Gui,2: Hide
Return



Problem #3: I also have the same problem with the Enter key in your example. :(
Confusingly there is this post which states that the problem with the Enter key has been solved by using the mozilla activex control, but I don't understand a word of it. Maybe you can make sense out of it. I think it relates to a AutoHotkey script that, like yours, uses the "library".



Problem #4,5: I don't understand where you want to move the webpage to? sorry


I hope that helps a little


Greetings
Wolf

4
Only today I noticed that there is another question unanswered:

and the line: @echo off, that removes extra spaces right?
-reply#4

It toggles the "default batch echo" state OFF, which is otherwise ON. Now to understand what the default batch echo does, take the following code:

echo on
echo 1
echo.
echo 2

echo off
echo 3
echo
echo 4

What happens here is this:
echo on     : this line will switch the echo state ON (unnecessary, it is ON anyway), and put out a message about the new state: ECHO is on
echo 1      : this will put out the string "1"
echo.        : this will put out a empty line
echo 2      : this will put out the string "2"
               : this will put out a prompt (C:\TestCopy\>) or similar
echo off    : this will switch the default batch echo off, and put out a message about the new state: ECHO is off
echo 3      : this will put out the string "3"
echo         : this will put out a message about the state of the default batch echo: ECHO is off
echo 4      : this will put out the string "4"

The output of that batch is very messy. Quite often I want to have empty lines in my code (for structuring) and I don't want to see the prompt echoed to the screen. That is why I have put "echo off" in the first line of the batch file in reply #3. If you remove the "@" sign from that batch you will still see the message "ECHO is off", because when the batch starts, the echo is on, and the first command will create some output. It switches the echo off for all the following lines, not for itself.

The "@" sign in front of any line switches the echo off for that particular line only. So in a batch with only one line you could write:

@for %%f in (myicon.ico, myieshortcut.url) do copy "C:\TestCopy\%%f" "C:\Documents and Settings\All Users\Desktop\TestCopy\datafolder"

and get the same effect (avoid messy output).


Greetings
Wolf

5
Post New Requests Here / Re: IDEA: a Self-Contained Archive
« on: November 19, 2007, 07:24 PM »
Please make an effort to try to find existing programs that do what you are asking for before you post an Idea request; this section is not meant to be a coding excercise, so if the program already exists (as freeware), then there is little point having someone here re-implement it.

I have just found the above here
- DC forums
-- Software
--- Coding Snacks
---- Post New Requests Here
----- Topic: When writing code means you've failed.. READ IN
and would like to ask for guidance, please.

I believe that psionics has been directed to come here, and I am offering a helping hand, but it will be a coding exercise. The functionality of the code is of limited use (even if it is working as laid out), as it only provides a customised front-end to an existing application. Where shall we go with this?


Greetings
Wolf

6
Post New Requests Here / Re: IDEA: a Self-Contained Archive
« on: November 19, 2007, 06:26 PM »
There is no need to be sorry, I just was not sure if we talk about the same thing. :)

image files
I am not trying to patronise, or to correct you, but I think that most people will understand the term "image" (eg ISO image, CD image, diskette image) like this: It is a file that represents an exact copy of the entire filesystem on the CD/floppy. There are also hard disk images possible. The image file can also be compressed, eg Ghost Images, WinImage files (*.imz). But this is not written in stone.


I think now that we are indeed talking about the same thing: A single standalone EXE with the possibilities that you mentioned. And a build-in "budding/cloning" option, so you would not have to copy an existing instance (which might be BIG), and then delete all the files from inside to get a new/empty archive (single standalone EXE).

I don't want to get your hopes up, but I regard your idea as a very interesting one. I will try and see what I can do. Just so you know what to expect, I'm not the fastest coder in the west, that title is definitely taken. For me it will be a challenging project that I use to teach myself some advanced aspects in programming. Maybe/hopefully a true programmer will step in and deliver a solution before I get to write as much as a GUI for this. My first attempt will be to create such an application, without encryption or compression, so it is a waste of space (you can have that by creating an normal folder). Other than that, it could serve as a bad example for writing code, or we could show it to a real programmer and ask for directions how to implement zip compression (with encryption).

Actually "spawning" might be a better alternative to call the process of creating a new/empty archive.


Greetings
Wolf

7
Post New Requests Here / Re: IDEA: a Self-Contained Archive
« on: November 19, 2007, 12:59 PM »
but it is more easy for the users if it is built-in to the image/app file

What image/app file are you referring to? I talk about the standalone EXE that you requested. I have taken the liberty to modify your lovely picture so you can see what I mean.

SFX.in.GUI.png

I also would like to adjust my terminology like such (took me a while to find the correct english word):
"Mother" is the standalone EXE in the picture above. Child is the "newborn" standalone EXE that you can name, that is empty, and that has the default icon recreated. This process is not cloning but budding. Sorry for not including a picture of SpongeBob budding, I failed to find one.


Greetings
Wolf



8
Living Room / Re: Poem of English Pronunciation
« on: November 17, 2007, 08:08 PM »
I grew up in the neighborhood of Pfalz, Germany namely Saarland, Germany. And I remember that as a child, my teachers were always trying to get us to speak proper German. They did that by telling us that my local dialect sounds stupid and uneducated. In Saarland, some schools teach french as the first foreign language, which makes it the third language that I learned before I ever learned any English. After having worked in the UK for more than ten years, I now regard my dialect no more stupid than eg the swiss dialect, (a variation on the German language) that is even spoken on their national television. I have worked in Switzerland as well and know from personal experience that even lectures are held in their dialect.

Anyway, I would miss it when local dialects or Scottish, Irish, South African, Australian and so on, disappeared. It adds so much colour (mind the "u") to the language. I have found that "Queens English" is invaluable for an German in Birmingham, Huddersfield or Ashington (all UK), given the fact that you want to communicate. I remember my first day in the UK, when I could not answer the question "Would you like a cup of tea?" because I understood not a single word of it.


Wolf

9
Living Room / Re: drum program
« on: November 17, 2007, 07:40 PM »
Hi jgpaiva,

Now I have to look up "pejorative" as well. But I did understand
that nick is considered abusive/offensive

Thanks for enlightenment.



Hi f0dder,

after having learned my lession, I see now that your comment was not a bad joke, but a sign of your caring for people that might be offended. Hope you weren't offended by me being shocked, and writing about it.


Greetings
Wolf

10
Living Room / Re: drum program
« on: November 17, 2007, 07:18 PM »
OK, I have read How did "faggot" get to mean "male homosexual"? pointed to by google. I did misunderstand it as a unusual spelling of a musical instrument. In my mother language there is an instrument called "Fagott", and in my ignorance I thought it may be the same or similar in English, (as is the case for other instruments like organ=Orgel, trumpet=Trompete ...).

Now I wonder whether the members of this forum actively discourage the membership of people that are homosexual and admit to it. Or is there some taboo attached to the nickname, that I still don't get?

Wolf

11
Living Room / Re: drum program
« on: November 17, 2007, 06:59 PM »
Hi faggot,

Welcome to DonationCoder forum !!! :)

After being shocked at first, having read the first reply, I thought this must be some kind of joke I don't get. But reading the reply#3, I now think being shocked was the correct initial emotion. [#3 made me laugh!!! Thank you, Cpilot.]

I want to encourage you to not judge the forum on the base of the first reply you got, following your first ever post. Most people here are very friendly, and I hope user f0dder might care to explain the bad joke.

Welcome to DonationCoder forum !!! :Thmbsup:

Unfortunately, I can not give an answer to your question, as I don't know anything about music applications.


Greetings
Wolf

12
Post New Requests Here / Re: IDEA: a Self-Contained Archive
« on: November 17, 2007, 04:53 PM »
im looking for someone who can code this apps. or similar

"a Self Package (SFX) ~ .exe with explorer-like GUI"

* Drag n Drop files inside that box (there is only two way)
* updates(overwrites) the file when there's duplicate
* able to delete the file inside by pressing del key or rightclick delete
* independent, which mean, the extracting and compressing feature in built-in.. like a shell, a single file, self-contained, portable
* wish list: encryption function and password (or else, will just act like the default XP zip folders)

that would be great..

I quoted from the other thread, to have the info visible here as well as available.

How about a "cloning" option: New archive -> will pop up a dialogue for the name of a new, empty archive and create for example NewFancySelfContainer.exe, which will be some kind of build-in "distributor", as you don't want an installer for it. In case the "mother" has already been patched with a different icon, then maybe allow the default icon to be recreated, as that would ensure to have all "newborns" identical.

Sorry for my terminology.



Would you pay high attention to the efficacy of the build-in compressor, or is plain zip OK? I am wondering also about the use of temporary files on the target computer, in case you need to add or remove large multimedia files.
The problem with these is that a lot of them are "prepacked" and take a long time to re-pack.

Would you consider to have this app build as a container-only (compression level set to store only), with strong encription of the files within, or is that no good for your needs?


Greetings
Wolf

13
My interpretation: it will send all subsequent "GuiControl" commands to the now default window (97). Unfortunately there is no warning/error message if the control on the otherwise default window (maybe 1) does not exist. Alternatively the following code might suit your needs even better (I inserted "97:" as first parameter between the two consecutive commas):

;Loading GUI
 Gui,97: Add, Text, , CompuTech SnapSuite is loading...     ;Adds text "CompuTech SnapSuite is loading" to the window
 Gui,97: Add, Progress, vSnapSuiteLoadingProgress w300 h32     ;Adds (supposedly) the loadingbar, under the variable SnapSuiteLoadingProgress. The bar is 300 pixels wide by 32 tall.
 Gui,97: Show, Center, CompuTech SnapSuite is loading...     ;Shows the window, with the title "CompuTech SnapSuite is loading..." in the center of the screen.
 GuiControl,97:, SnapSuiteLoadingProgress, +50     ;Makes the progress bar add 50% [Wolf: direct to Gui number 97]
 Sleep 5000     ;Sleeps 5 seconds
 ExitApp     ;Exits the testing bar program...whatever you want to call it

Default
Changes the current thread's default GUI window number, which is used whenever a window number is not specified for GuiControl, GuiControlGet, and the Gui command itself. In the following example, the default window number is changed to two: Gui 2:Default. See thread's default window for more information about the default window.
-AutoHotKey.chm
Creating Multiple GUI Windows
For windows other than the first, the window's number is used as a prefix for the special labels mentioned above; for example, 2GuiEscape and 2GuiClose would be the default labels for the second window. To use custom label names, see Gui +Label.

Each script may have up to 99 GUI windows simultaneously. To operate upon a window number other than the default, include a number followed by a colon in front of the sub-command as in these examples:

Gui, 2:Add, Text,, Text for about-box.
Gui, 2:ShowGui 2:Default can be used to avoid the need for the "2:" prefix above.

Performance might be slightly better for lower window numbers than higher ones.
-AutoHotKey.chm


Greetings
Wolf

14
Living Room / Poem of English Pronunciation
« on: November 16, 2007, 09:59 PM »
I have found several publications of this funny poem on the web: "The Chaos" by Gerard Nolst Trenité aka Charivarius (1870-1946)
  • I give this link: Pronunciation Help?, because it mentions the origin of the poem.
  • Here you can find the same poem with downloadable *.rm files (most likely sound). There is also a link for getting a compatible player on that site. I have not tested the player myself and can not comment on it.
  • English pronunciation same poem and more like it.
The Chaos

Dearest creature in creation,
Study English pronunciation.
I will teach you in my verse
Sounds like corpse, corps, horse, and worse.
I will keep you, Suzy, busy,
Make your head with heat grow dizzy.
Tear in eye, your dress will tear.
So shall I! Oh hear my prayer.

Just compare heart, beard, and heard,
Dies and diet, lord and word,
Sword and sward, retain and Britain.
(Mind the latter, how it's written.)
Now I surely will not plague you
With such words as plaque and ague.
But be careful how you speak:
Say break and steak, but bleak and streak;
Cloven, oven, how and low,
Script, receipt, show, poem, and toe.

Hear me say, devoid of trickery,
Daughter, laughter, and Terpsichore,
Typhoid, measles, topsails, aisles,
Exiles, similes, and reviles;
Scholar, vicar, and cigar,
Solar, mica, war and far;
One, anemone, Balmoral,
Kitchen, lichen, laundry, laurel;
Gertrude, German, wind and mind,
Scene, Melpomene, mankind.

Billet does not rhyme with ballet,
Bouquet, wallet, mallet, chalet.
Blood and flood are not like food,
Nor is mould like should and would.
Viscous, viscount, load and broad,
Toward, to forward, to reward.
And your pronunciation's OK
When you correctly say croquet,
Rounded, wounded, grieve and sieve,
Friend and fiend, alive and live.

Ivy, privy, famous; clamour
And enamour rhyme with hammer.
River, rival, tomb, bomb, comb,
Doll and roll and some and home.
Stranger does not rhyme with anger,
Neither does devour with clangour.
Souls but foul, haunt but aunt,
Font, front, wont, want, grand, and grant,
Shoes, goes, does. Now first say finger,
And then singer, ginger, linger,
Real, zeal, mauve, gauze, gouge and gauge,
Marriage, foliage, mirage, and age.

Query does not rhyme with very,
Nor does fury sound like bury.
Dost, lost, post and doth, cloth, loth.
Job, nob, bosom, transom, oath.
Though the differences seem little,
We say actual but victual.
Refer does not rhyme with deafer.
Foeffer does, and zephyr, heifer.
Mint, pint, senate and sedate;
Dull, bull, and George ate late.
Scenic, Arabic, Pacific,
Science, conscience, scientific.

Liberty, library, heave and heaven,
Rachel, ache, moustache, eleven.
We say hallowed, but allowed,
People, leopard, towed, but vowed.
Mark the differences, moreover,
Between mover, cover, clover;
Leeches, breeches, wise, precise,
Chalice, but police and lice;
Camel, constable, unstable,
Principle, disciple, label.

Petal, panel, and canal,
Wait, surprise, plait, promise, pal.
Worm and storm, chaise, chaos, chair,
Senator, spectator, mayor.
Tour, but our and succour, four.
Gas, alas, and Arkansas.
Sea, idea, Korea, area,
Psalm, Maria, but malaria.
Youth, south, southern, cleanse and clean.
Doctrine, turpentine, marine.

Compare alien with Italian,
Dandelion and battalion.
Sally with ally, yea, ye,
Eye, I, ay, aye, whey, and key.
Say aver, but ever, fever,
Neither, leisure, skein, deceiver.
Heron, granary, canary.
Crevice and device and aerie.

Face, but preface, not efface.
Phlegm, phlegmatic, ass, glass, bass.
Large, but target, gin, give, verging,
Ought, out, joust and scour, scourging.
Ear, but earn and wear and tear
Do not rhyme with here but ere.
Seven is right, but so is even,
Hyphen, roughen, nephew Stephen,
Monkey, donkey, Turk and jerk,
Ask, grasp, wasp, and cork and work.

Pronunciation -- think of Psyche!
Is a paling stout and spikey?
Won't it make you lose your wits,
Writing groats and saying grits?
It's a dark abyss or tunnel:
Strewn with stones, stowed, solace, gunwale,
Islington and Isle of Wight,
Housewife, verdict and indict.

Finally, which rhymes with enough --
Though, through, plough, or dough, or cough?
Hiccough has the sound of cup.
My advice is to give up!!!

Who is up to the challenge to read it aloud?


Greetings
Wolf

15
I added the following line:

Gui,97: Default

like this:

;Loading GUI
 Gui,97: Add, Text, , CompuTech SnapSuite is loading...     ;Adds text "CompuTech SnapSuite is loading" to the window
 Gui,97: Add, Progress, vSnapSuiteLoadingProgress w300 h32     ;Adds (supposedly) the loadingbar, under the variable SnapSuiteLoadingProgress. The bar is 300 pixels wide by 32 tall.
 Gui,97: Show, Center, CompuTech SnapSuite is loading...     ;Shows the window, with the title "CompuTech SnapSuite is loading..." in the center of the screen.
 Gui,97: Default
 GuiControl,, SnapSuiteLoadingProgress, +50     ;Makes the progress bar add 50%
 Sleep 5000     ;Sleeps 5 seconds
 ExitApp     ;Exits the testing bar program...whatever you want to call it


Greetings and get well soon!
Wolf


16
A note on writing comments inside batch files: (sorry, I am getting carried away)

the keyword "rem" is not universally useful for commenting out lines inside batch files. It really is a "do-nothing" command and it will be executed. This can lead to strange behavior to say the least. Take for example the following line inside a batch file:

...
echo Some text that will appear in the file test.txt > test.txt
...

Now let us assume that I want that line to be ignored (commented out), but I don't want to delete it, to save me remembering, with the option to include the line later again ... If I added the command rem in front of the line like so:

...
rem echo Some text that will appear in the file test.txt > test.txt
...

I will get this behavior: the command "rem" with the parameters "echo Some text that will appear in the file test.txt" will be executed and do nothing, that is: it will produce no output. But that empty output will still be redirected to the file test.txt. It is the redirection (">") that will now create an empty file test.txt. The danger here is that redirection does not ask for confirmation when overwriting an existing file. I repeat: rem is a command, that will be executed and, when used for commenting out a line that contains redirection, the redirection will be carried out as well.

Solution:
I use the double colon ("::") to comment out lines that I want to temporary be ignored, or for writing comments inside batch files. The behaviour of that can be regarded as such: Any line beginning with a colon is treated as a label. If the second character (first character of the label name) is an illegal character for a label name, then the entire line will be ignored. The following line inside a batch file will not produce an empty file called test.txt, and it will not overwrite an existing file:

...
:: echo Some text that will appear in the file test.txt > test.txt
...


Greetings
Wolf

17
A note on using two percent signs inside batch files, when using the for command. There are other similar cases as well:

The command line interpretor reads the batch file line by line. When it comes across a line that reads for example:
set PATH=%PATH%;C:\TOOLS
then it will append the directory C:\TOOLS to the current path. This is achieved by doing a replacement before execution. When the line is read, the CLI will replace the expression %PATH% with the string that is stored inside the environment variable called PATH (usually a list of folders, separated by semicolons). Lets assume for the sake of easy examples that the PATH would be C:\WINDOWS;C:\WINDOWS\COMMAND at the beginning. Replacement leads to the following command being executed:
set PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\TOOLS
Relacement (also called expansion of variables) is done first, execution is done second.

Now the for command is special, as you don't want the variable %f to be expanded, you want to assign something to it. If you were to write on the command line (DOS prompt) this:
for %x in (1 2 3) do echo %x
you would get what you want, because it is not inside a batch file and is correct syntax.The same line inside a batch file would produce a syntax error, secondary to expansion of %x to an empty string, resulting in the execution of:
for in (1 2 3) do echo
and that is missing the necessary name for the variable.

The solution is the special expansion of double percent signs: "%%" expands to (the shorter) "%", and the line:
for %%x in (1 2 3) do echo %%x
will expand to the correct line:
for %x in (1 2 3) do echo %x

Note that the name of the variable (here: x) is just added on after the expansion ot "%%", just like all the other letters.

Short: at the prompt use one, in batch files use two percent signs. (Applies only to special commands like for)


Greetings
Wolf

18
Thanks tinjaw,

Yes , I should have specifically said in reply #13, that the renaming can be done, instead of just
... that can be done.
My reason for "breaking" the flow of discussion at that point was to admit that
  • eighther I have to go and study the syntax of cmd.exe (I really should do that!) and both of foolios and myself benefit from the discussion at a very slow rate (nothing wrong with that), or
  • we switch to an alternative command line interpreter.

In my humble opinion, it is easier to start learning batch programming for 4DOS than it is to learn it for cmd.exe. Let me admit that my opinion is mainly based on the fact that I never really bothered to tackle the second, because I thought why learn a batch "dialect" that does not give good help. I am very fond of the help system that came with MS-DOS 6.22 and 7.10. Only many years later I had first contact with cmd.exe, which I believe is also much more powerful than command.com. But secondary to lack of good help being available to me, and the fact that 4DOS did everything I wanted it to do, and I already knew the features, I ended up ignoring cmd.exe as a command line interpreter.

For now I just give a sample batch file that I think will be easy enough for beginners to look at, and that slowly introduces some of the power of 4DOS:

:: TEST.BAT
:: by Wolf
::
@echo off

:: The following line will branch the flow of execution the the label called
:: Continue, if the expression evaluation returns true. All MS DOS command
:: line processors will evaluaye the condition as false because they treat
:: both sides of the double equal signs as STRINGS. "1.0" and "01" are not
:: the same. 4DOS has the ability to recognise the case here that on both
:: sides of the double equal signs, we have numerical expressions, that
:: evaluate to the same number.

if 1.0 == 01 goto Continue

:: default command line processor will call 4DOS to run the same batch as
:: well, with added parameters on the command line. After 4DOS finishes, it
:: will give control back to the default command line processor.
if exist 4dos.com 4dos.com /c %0 this is test batch
if not exist 4dos.com echo Sorry, 4DOS.COM not found.

goto End

:Continue
echo Command line: %0&
echo Command line parameters: %&
echo.
echo Batch file name:   %0
echo First parameter:   %1
echo Second parameter:  %2
echo Third parameter:   %3
echo Fourth parameter:  %4

:End


In case anybody wants to provide enlightenment, as to what the equivalent batch would be for cmd.exe, please post. In the meantime I do a bit of research myself.


Greetings
Wolf


19
No need to install it. We don't want to create dependencies. The batch files for 4DOS will work on many OS: all MS DOS versions since version 3.3 (1990[edit:1988]). All Windows versions since 3.0. As cranioscopical has pointed out correctly, the alternative 4NT is recommended for MS OS that are based on what they call "New Technology", such as Windows NT, Win2000, Win2003, WinXP, and Vista. The drawback is that you only get a time limited version for free. The full version is quite expensive. Everything that you write for 4DOS will be useful for 4NT as well. So I suggested 4DOS for a start and you can always change to 4NT later. At the moment I think for learning batch commands the free 4DOS will be good.


20
4DOS Revived!

Click on the button that says "Binaries" to download the zip file. For a start, you would only need one file from inside called 4dos.com.

21
Yes, than can be done. I have to admit that I am not very good at the syntax of batch files written for cmd.exe. I am happy to try and find solutions for your needs. But I wonder if you would consider to use an alternative "command line interpreter". I am used to write batch files for 4DOS, which is open source and free. It used to cost money, but not anymore. I would be able to give sound advice in case you are interested. You would not even have to install it, just copy 4dos.com into the same directory as the batch file you are writing, and I can show you how to make use of the powerful options that 4DOS gives you.

So will it be cmd.exe or 4DOS? Please don't feel pushed to something that you don't want, be honest. It would just easier for me to give hints quickly.

I go and search for the link now.

22
Is there anything I can do for you my friend?

Yes, please continue asking questions, that I can answer. That keeps me off the road. :)

Wolf

23
Yes, it appears correct.
Make sure that the batch file is started from the USB device. Will you keep that batch file there?

another hint: in case you gave "Al lUsers" as an example to protect your privacy (well done!), and plan to write your batch file so that it copies to your personal desktop folder, you could use the build-in environment variable "USERPROFILE" like this:
@echo off
for %%f in (myicon.ico, myieshortcut.url) do copy "\TestCopy\%%f" "%USERPROFILE%\Desktop\TestCopy\datafolder"

That will copy the two named files from the folder TestCopy in the root of the current drive to the folder TestCopy of your personal desktop.


Buddy list is great!
Have fun!

24
Only after I wrote my last reply, I noticed your edits.

Try this:
@echo off
for %%f in (myicon.ico, myieshortcut) do copy "C:\Documents and Settings\All Users\Desktop\TestCopy\%%f" "C:\Documents and Settings\All Users\Desktop\TestCopy\datafolder"

The answer to spaces in the file name or folder name is double quotes.


Greetings
Wolf

25
It displayed the file extension. Thank you so much.
My pleasure.

At the command prompt you can type: help for > help.txt and study the help text file that appears in the current directory. But it is awful to read. My interpretation would be:

for %%f does assign a value to an environment variable called %f. The value will be the string "myicon.ico" in the first iteration, and "myieshortcut.url" in the second iteration. Those values are found by the for command inside the set that you give it after the keyword in between the round brackets here: in (myicon.ico, myieshortcut.url). I took the liberty to assume that the extension actually is url. For every value the for command finds inside the "set", it creates a command that looks like the rest of the commandline (after the keyword do) and the expression %%f is substituted with the current value of the environment variable. So it does in this particular case the following two commands like this:
copy C:\TestCopy\myicon.ico C:\TestCopy\datafolder
copy C:\TestCopy\myieshortcut.url C:\TestCopy\datafolder
The syntax in a easy (not entirely correct) version is: for xxx in (yyy) do zzz
This is just to illustrate the position of the necessary keywords.

For studying if your intended lines are correctly created, you could use the echo command like this:
@echo off
for %%f in (myicon.ico, myieshortcut) do echo copy C:\TestCopy\%%f C:\TestCopy\datafolder


Greetings
Wolf


Pages: [1] 2 3next