Batch file question

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
 
P

Pegasus [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top