Batch file question

  • Thread starter Thread starter qq
  • Start date Start date
Q

qq

Hi All,

I am writing a batch file for my clients, I called copyfolder.bat. In the
batch file, I run Robocopy to copy folder to another location. I know I can
set %1 in copyfolder.bat, then client can typ copyfolder.bat foldername in
command prompt sceen to run. But the client wants to have a icon on desktop
and wants to get prompt to show him, for example, I setup copyfolder.bat icon
on the desktop, when the client click the icon, then another screen come up
and asking questions: Please type folder name: , then, the client type folder
name, Enter, then, run.

I don't know how to input the folder name and how to transfer the folder
name to my batch file.

Can any body help me out? thanks a lot.

--qq
 
qq said:
Hi All,

I am writing a batch file for my clients, I called copyfolder.bat. In the
batch file, I run Robocopy to copy folder to another location. I know I
can
set %1 in copyfolder.bat, then client can typ copyfolder.bat foldername in
command prompt sceen to run. But the client wants to have a icon on
desktop
and wants to get prompt to show him, for example, I setup copyfolder.bat
icon
on the desktop, when the client click the icon, then another screen come
up
and asking questions: Please type folder name: , then, the client type
folder
name, Enter, then, run.

I don't know how to input the folder name and how to transfer the folder
name to my batch file.

Can any body help me out? thanks a lot.

--qq

Here you go:
@echo off
set /p folder=Please enter the folder name:
if "%folder%"=="" goto :eof
echo Processing "%folder%". Please wait.

Or if you want something a little snazzier:
[1] @echo off
[2] echo > c:\input.vbs wscript.echo Inputbox("Please enter the folder
name:")
[3] for /F "delims=" %%a in ('cscript //nologo c:\input.vbs') do set
folder=%%a
[4] if "%folder%"=="" goto :eof
[5] echo Processing "%folder%". Please wait.

Remember to unwrapped any line that your newsreader might have wrapped
around and to remove the line numbers.
 
Back
Top