teach a noob
Posted: 29 Mar 2011 19:19
hello guys! its nice to have a site like this! Im 30 years old and i wanted to start a new hobby- programming
i have red sites and discussions in forum about when should i start. Many says, that i should start python, or c, or c++.. or java..im doing java at a moment but i realized i been missing some critical topics that i need to tackle with other language ( familliarity). anyways, what am trying to say is that i decided to give effort on dos batch programming atleast 60% dos batch and 40% to laguage what im currrently doing as a hobby. that thing is am continually amazed by how batch program works. so i base my decision on how i felt about now about this batch program. i've done a simple beginner program like hiding folder and moving file ,open a multiple program and stuff.. these are really basics. but now i came to a point that i need more script to study with and that i ended up here looking. while doing my journey in batch file progamming i wanted to know about this:
- im currenlty working on a kind of script,batch program ..what ever you call it.. the thing is i want to make a script that will store a data and retain that stored data to a variable even after i exit the batch file.
here's what i really wanted:
enter path of folder and press enter : (explorer will pop-up, i'll copy the folder path)
(enter pressed)enter you fodler path here: ( paste or just type in the fodler path)
(enter pressed)hide folder? (y/n): ( enter "y" folder is hiden, if "n" goto viewfolder option)
(enter pressed)view folder?(y/n): ( enter "y" folder is availble, if "n" goto hide folder option)
(exit batch file)
(open batch file)now made a if else at the start of batch" (this part should actully be located at start)
the command is if exist "%path_entered%" goto hideOption
goto viewFolder
..lol for this... i made the script but if you exit it doesn't store a path that i entered.. lol.. im really challenged by this , i meant for a starter i want this kind of script. now i tried the for %%x (the script with %path_entered%) " but i reallized after viewing the the edited batch file(CallFodler.bat) doesn't store the path in usinhg this command statement even i put the %path_entered%" do (echo %%x >> C:\CallFolder.bat).. i tried to do this statment but every string that is seperated by space is entered on the next line.. lol..
now what is CallFOlder.bat you may ask. well since i figure atleast at the moment that i cant store a data to a variable whenever i exit the batch file, i tried to include an "editing batch" using for %%x in () do () statement within the batch file and store it in CallerFodler.bat so that if i exit the batch file the next time i enter it will do the the command to hide and view the folder respectively.
well guys good luck with this if you want to help me .. will really appreciate it. and thanks in advance! i hope you guys can teach me as i go along learning this batch scripting stuff.. GOdbless!
i have red sites and discussions in forum about when should i start. Many says, that i should start python, or c, or c++.. or java..im doing java at a moment but i realized i been missing some critical topics that i need to tackle with other language ( familliarity). anyways, what am trying to say is that i decided to give effort on dos batch programming atleast 60% dos batch and 40% to laguage what im currrently doing as a hobby. that thing is am continually amazed by how batch program works. so i base my decision on how i felt about now about this batch program. i've done a simple beginner program like hiding folder and moving file ,open a multiple program and stuff.. these are really basics. but now i came to a point that i need more script to study with and that i ended up here looking. while doing my journey in batch file progamming i wanted to know about this:
- im currenlty working on a kind of script,batch program ..what ever you call it.. the thing is i want to make a script that will store a data and retain that stored data to a variable even after i exit the batch file.
here's what i really wanted:
enter path of folder and press enter : (explorer will pop-up, i'll copy the folder path)
(enter pressed)enter you fodler path here: ( paste or just type in the fodler path)
(enter pressed)hide folder? (y/n): ( enter "y" folder is hiden, if "n" goto viewfolder option)
(enter pressed)view folder?(y/n): ( enter "y" folder is availble, if "n" goto hide folder option)
(exit batch file)
(open batch file)now made a if else at the start of batch" (this part should actully be located at start)
the command is if exist "%path_entered%" goto hideOption
goto viewFolder
..lol for this... i made the script but if you exit it doesn't store a path that i entered.. lol.. im really challenged by this , i meant for a starter i want this kind of script. now i tried the for %%x (the script with %path_entered%) " but i reallized after viewing the the edited batch file(CallFodler.bat) doesn't store the path in usinhg this command statement even i put the %path_entered%" do (echo %%x >> C:\CallFolder.bat).. i tried to do this statment but every string that is seperated by space is entered on the next line.. lol..
now what is CallFOlder.bat you may ask. well since i figure atleast at the moment that i cant store a data to a variable whenever i exit the batch file, i tried to include an "editing batch" using for %%x in () do () statement within the batch file and store it in CallerFodler.bat so that if i exit the batch file the next time i enter it will do the the command to hide and view the folder respectively.
well guys good luck with this if you want to help me .. will really appreciate it. and thanks in advance! i hope you guys can teach me as i go along learning this batch scripting stuff.. GOdbless!