BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« on: February 14, 2009, 07:18:31 PM » |
|
This is my program which makes folders. The user just types in how many folders he wants to make and he can make that many.
@echo off title Folder Maker color 0a
cls set /p folder=How many folders would you like to make: for /l %%a in (1,1,%folder%) do ( cls set /p foldername=What would you like to name folder #%%a: mkdir "%foldername%" set foldername= )
msg * All folders created!
But this throws back an error message saying "The system could not find the enviroment option that was entered" . Any way to fix this ?
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #2 on: February 14, 2009, 07:44:08 PM » |
|
After I name the folder to make it throws the error message.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #5 on: February 14, 2009, 08:25:38 PM » |
|
And why would you need something like this? More computer pranks?
This is quite far from computer pranks. Think before you speak. This is so you don't have to spend you time making a menu to ask how many folders you want to make.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #7 on: February 14, 2009, 08:35:41 PM » |
|
of which the practical applications are? I don't quite get what you mean there. But, back to the question. Is there a way to fix it so it won't throw out that error message and make the folders.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
GuruGary
Posts: 771

|
 |
« Reply #8 on: February 14, 2009, 09:05:33 PM » |
|
When you use environment variables that were set inside a FOR loop, you typically need to use the "setlocal enabledelayedexpansion" and then access them with ! instead of %. Here is your script with those 2 changes:
@echo off setlocal enabledelayedexpansion title Folder Maker color 0a
cls set /p folder=How many folders would you like to make: for /l %%a in (1,1,%folder%) do ( cls set /p foldername=What would you like to name folder #%%a: mkdir "!foldername!" set foldername= )
msg * All folders created!
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #9 on: February 15, 2009, 08:23:11 AM » |
|
Thanks, that worked.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #11 on: February 15, 2009, 12:23:24 PM » |
|
It's not about how many folders I can make. It's that I don't want to make a big menu asking how many folders I want to make.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
|
|
|
|
Dias de verano Guest
|
 |
« Reply #14 on: February 15, 2009, 01:20:41 PM » |
|
why would you want a menu that asks you to create folders when it's far easier to do so using md and cd commands?
Because beginning batch programmers love to create 150 line batch files with 56 labels that do the same thing as typing "DIR", maybe?
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #15 on: February 15, 2009, 01:26:23 PM » |
|
No, with this I don't use labels. I do this. if %question%==1 ( mkdir %foldername% ) if %question%==2 ( mkdir %foldername% mkdir %foldername% )
and so on. I don't use goto in this situation. And I still want to know why you need to make so many folders
It's not like I'm actually going to make hundreds of folders. I never even said I was going to make hundreds of folders. So will you just cool it.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
Dias de verano Guest
|
 |
« Reply #16 on: February 15, 2009, 01:43:24 PM » |
|
I see sarcasm is wasted on you, BatchFileCommand. By the way, leave the attitude at the door in future, OK?
|
|
|
|
|
|
|
BatchRocks
Thanked: 3 Posts: 326

|
 |
« Reply #18 on: February 15, 2009, 05:05:15 PM » |
|
And why would you need something like this? More computer pranks?
This is quite far from computer pranks. Think before you speak. This is so you don't have to spend you time making a menu to ask how many folders you want to make.
*WINK* Of course this isn't a 'prank'. I know the use for it, but, why is making a folder a "prank". And I still want to know why you need to make so many folders
Stop being nosy, something can be hidden but useful, and not wanted to be public...
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #19 on: February 15, 2009, 06:22:54 PM » |
|
Oh. I also used the same strategy to move folders.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #21 on: February 15, 2009, 07:51:10 PM » |
|
Strategy doesn't have to be complicated at all.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #24 on: February 16, 2009, 01:10:45 PM » |
|
Exactly. If you want to hide something.... RAR file with a password
What is the point of telling me that. If I want to hide something. attrib "folder" +h +r
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #26 on: February 16, 2009, 01:14:59 PM » |
|
No, it's not. Why would I put compress something to RAR, if you use the folder or file frequently a password would be roadkill.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
Dias de verano Guest
|
 |
« Reply #27 on: February 16, 2009, 01:18:48 PM » |
|
What is the point of telling me that. If I want to hide something.
attrib "folder" +h +r
That is literally the most naive thing I have ever seen on this forum.

|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #28 on: February 16, 2009, 01:21:31 PM » |
|
So, you just click, do not show hidden folders. This is on your own computer isn't it?
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
Dias de verano Guest
|
 |
« Reply #29 on: February 16, 2009, 01:25:10 PM » |
|
If you hide something with attrib, who are you hiding it from? Not yourself. That would be silly. Somebody else therefore. Who can click "show hidden files and folders" and see all your goat porn.
|
|
|
|
|
BC_Programmer
Thanked: 697 Posts: 15,881
Computer: Specs Experience: Beginner OS: Windows 7

Pinkie Pie is best pony
|
 |
« Reply #30 on: February 16, 2009, 01:32:24 PM » |
|
No, it's not. Why would I put compress something to RAR, if you use the folder or file frequently a password would be roadkill.
it doesn't hide it. anybody can access it. a quick dir /a will reveal the files, and changing a few options in windows explorer will allow them to be displayed there, too. you also missed my previous point. If somebody can easily create folders in windows explorer or the command prompt, why add the additional complication of a clunky batch program to do this creation? RD is a wrapper to the OS function to remove directories which in and of itself is a paradigm exposed by the filesystem and subsequently stored on disk as a series of bytes. There are only so many levels of indirection before further abstraction becomes ridiculously unnecessary. As the big C has told you, acting like you know everything doesn't make it true, and this is directly related to your attitude towards perfectly valid suggestions. Calling them "stupid" and so forth doesn't instantly make your silly quests to wrap simple DOS functions in pages and pages of prompts and added features that really just add unnecessary bloat to the basic, simple, and yet oh so powerful commands. It's also somewhat silly to hint at the suggestion of knowing what I think. It is, and still is one the more naive things I've seen on this forum. Security by obscurity is just foolishness- If you want to prevent something from getting into the hands of others, it needs to be heavily protected via passwords and the like, hiding the files will simply draw attention to them by making it obvious that an attempt was made to keep the files out of the view of the casual user. Besides, what would you need to hide anyway? (which also begs the question of where this fork of the discussion came from) EDIT: password protected RAR files are the best way to store goat porn.
|
|
|
|
Dias de verano Guest
|
 |
« Reply #31 on: February 16, 2009, 01:38:07 PM » |
|
Look what I found on BFC's hard drive!
[Image Removed]
|
|
|
|
« Last Edit: February 16, 2009, 06:21:40 PM by Carbon Dudeoxide »
|
IP logged
|
|
|
|
|
|
Dias de verano Guest
|
 |
« Reply #33 on: February 16, 2009, 01:43:22 PM » |
|
That was a mild picture compared to some of the others.
|
|
|
|
|
|
|
Dias de verano Guest
|
 |
« Reply #35 on: February 16, 2009, 01:56:05 PM » |
|
[image removed]
Incidentally, if you want to store things away from prying eyes, not only password the rar file, but also give it a non-informative name, such as a mixture of letters and numbers, and take off the extension. That way, a casual click in Explorer will get the wannabe viewer nowhere. The command line rar.exe will extract from such a file if you use a wildcard for the filespec. (rar e *.* will find the header and merrily extract from any archive it finds)
|
|
|
|
« Last Edit: February 16, 2009, 06:22:09 PM by Carbon Dudeoxide »
|
IP logged
|
|
|
|
BatchRocks
Thanked: 3 Posts: 326

|
 |
« Reply #36 on: February 16, 2009, 05:34:32 PM » |
|
Dias, stop being a jerk and bossing everyone around.
Hiding the file, it's literally, HIDDEN, there aren't any buttons to 'unhide' or anything.
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #37 on: February 16, 2009, 06:13:56 PM » |
|
Go get yourself banned with those pictures. That's flaming.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
|
|
BC_Programmer
Thanked: 697 Posts: 15,881
Computer: Specs Experience: Beginner OS: Windows 7

Pinkie Pie is best pony
|
 |
« Reply #39 on: February 17, 2009, 03:20:09 AM » |
|
Dias, stop being a jerk and bossing everyone around.
Hiding the file, it's literally, HIDDEN, there aren't any buttons to 'unhide' or anything.
YES. THERE IS. It's a option right in windows explorer, "Show hidden files" (DER! I WONDER WHAT THAT DOES?) and a simple switch on a dir will reveal the files. there is nothing "hidden" about them. The only thing they will prevent is some casual user stumbling upon them- but 75% of the computer literate population is aware of the hidden files and folders checkbox. Dias isn't being a jerk. BFC is being the pompous know it all without the knowledge to back it up. Dias is a know it all, but only where applicable. Rather then simply SAY there is no way to "unhide" the file, maybe you should actually venture into the Folder options dialog. Go get yourself banned with those pictures. That's flaming.
No it isn't. You apparently don't know the definition of the word flaming. It was off-topic, but nothing more.
|
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #41 on: February 17, 2009, 06:17:39 AM » |
|
Having a signature that says you can hack EBAY doesn't really instill confidence in others when you say this isn't for anything bad.
Oh, you actually took that seriously? Hm, I thought no one would.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
Dias de verano Guest
|
 |
« Reply #42 on: February 17, 2009, 06:26:56 AM » |
|
Dias is a know it all, but only where applicable. Thanks for the words after the comma 
|
|
|
|
|
|
|
Dias de verano Guest
|
 |
« Reply #44 on: February 17, 2009, 12:09:56 PM » |
|
the 1% you don't know I'm sure you'll readily admit, unlike our friend BFC, who knows very little and yet will jump into any discussion as if it's his domain. If I don't know I generally don't bother posting, unlike some people, as I agree with the dictum of the philosopher Ludwig Wittgenstein, who wrote ""Whereof one cannot speak, thereof one must be silent."
|
|
|
|
|
|
|
|
|
BatchFileCommand Topic Starter
Thanked: 1 Posts: 339

|
 |
« Reply #47 on: February 17, 2009, 05:51:29 PM » |
|
lol, like when somebody listed a VB program and he claimed it needed to use echo.... OMG that was hilarious....
HAHAHAHHAHAHHHHA!!! Even I know thats not right!
Okay, that's retarded. I almost don't know anything about VB. But I do know that.
|
οτη άβγαλτος μεταφ βαθμολογία
|
|
|
|
|