Help
Posted: 28 Dec 2010 07:14
Hello,
Sorry if I am not clear enough or my enghlish is not goog :S.
I am kind of new in batch scripting and after several day reading a los of pages and websites I reach here where I think is the most usefull, and here is my question.
I need a batch file that creates a menu based in a list of folders (dir).
Example:
----
Menu: Select the opcion you want:
----
1- Folder 1
2- Folder 2
'
'
And so on.
The script also do another stuff which I have solved...
Down here is my script;
-----------------------------
@echo off
setlocal enabledelayedexpansion
set title=Menu Jimena
TITLE %title%
:EMPRIN
echo ::--------------------------------------------::
echo ::Recuerde Ingresar el nombre de la empresa ::
echo ::tal cual el nombre de la carpeta destino. ::
echo ::--------------------------------------------::
set /p name= Ingrese nombre de empresa: rem here the user inputs the name of the folder which I want to be automated so rem there is no place for errors. if they have only the option they can not make mistakes.
set destino=c:\"Pruebas\%name%"
If NOT EXIST %destino% goto :EMPRIN
set /p mes= Ingrese mes: rem user inputs the name of the folder to be created for copy the files.
cd %destino%
mkdir %mes% rem create the new folder for the files
cd %mes%
set carpeta=%destino%\%mes%\
:EMPLIN
echo ::--------------------------------------------::
echo ::Digitar "Fin" para no ingresar mas empleados::
echo ::--------------------------------------------::
set /p emp=Ingrese N Empleado: rem user input part of the name of the files to be copied.
If %emp% == Fin goto
OWN
set empleado=%emp%.pdf
set copia=B:\"Personal\Massimiliano\Nueva carpeta\%empleado%"
copy %copia% %carpeta%
goto :EMPLIN
OWN
cd C:\
--------------------------------------
Please help and if you find some way to improve my scrip is welcome!!!
Thanks in advance.
Sorry if I am not clear enough or my enghlish is not goog :S.
I am kind of new in batch scripting and after several day reading a los of pages and websites I reach here where I think is the most usefull, and here is my question.
I need a batch file that creates a menu based in a list of folders (dir).
Example:
----
Menu: Select the opcion you want:
----
1- Folder 1
2- Folder 2
'
'
And so on.
The script also do another stuff which I have solved...
Down here is my script;
-----------------------------
@echo off
setlocal enabledelayedexpansion
set title=Menu Jimena
TITLE %title%
:EMPRIN
echo ::--------------------------------------------::
echo ::Recuerde Ingresar el nombre de la empresa ::
echo ::tal cual el nombre de la carpeta destino. ::
echo ::--------------------------------------------::
set /p name= Ingrese nombre de empresa: rem here the user inputs the name of the folder which I want to be automated so rem there is no place for errors. if they have only the option they can not make mistakes.
set destino=c:\"Pruebas\%name%"
If NOT EXIST %destino% goto :EMPRIN
set /p mes= Ingrese mes: rem user inputs the name of the folder to be created for copy the files.
cd %destino%
mkdir %mes% rem create the new folder for the files
cd %mes%
set carpeta=%destino%\%mes%\
:EMPLIN
echo ::--------------------------------------------::
echo ::Digitar "Fin" para no ingresar mas empleados::
echo ::--------------------------------------------::
set /p emp=Ingrese N Empleado: rem user input part of the name of the files to be copied.
If %emp% == Fin goto

set empleado=%emp%.pdf
set copia=B:\"Personal\Massimiliano\Nueva carpeta\%empleado%"
copy %copia% %carpeta%
goto :EMPLIN

cd C:\
--------------------------------------
Please help and if you find some way to improve my scrip is welcome!!!
Thanks in advance.