Computing.Net > Forums > Disk Operating System > Batch File: Commands/Prompts

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File: Commands/Prompts

Reply to Message Icon

Name: FARUK
Date: May 3, 2000 at 13:15:18 Pacific
Comment:

Hello,

I am trying to create a batch file that copies files from one drive to another. However, the files that I am copying to the new drive will take on a different name.

Is there a way to create a batch file that will specify the DOS syntax for copying the files from one drive to another but also give you a prompt to type in the new name for the file going to the destination drive:

ie) copy test.txt d:\backup\050200.txt

I would want an opportunity to change the destination file name 050200.txt to 050300.txt or any other name that I choose before it is copied over.

Any suggestions on how to create popups in DOS would also be helpful.

Hopefully this makes sense and someone can offer some help or other resources.

Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: The Pirate
Date: May 3, 2000 at 20:38:04 Pacific
Reply:

Considered C++?


Fuck me! Yar dreaming sailor!


0

Response Number 2
Name: Grant
Date: May 4, 2000 at 19:49:06 Pacific
Reply:

What will you give me if i can come up w/ a batch file that will do it?? :) i have done something like it before, the hard part is getting dos to prompt for input during the batch process... Do you want to use pure DOS utils or are 3rd party ok? It can be done w/ DOS utils, ie DATE,FC,FIND but it is kinda hard. All i want in doing this is braging rights.

Do you want the batch file to give a suggested name or just a blank line for input?


0

Response Number 3
Name: World Library
Date: May 10, 2000 at 14:05:45 Pacific
Reply:

Hi,
Below is a simple bat using the user input.
See (copy con).
Have the input sent to a secondary bat.
It will rename the file.

Sorry this paper doll comes up a little scrambled on the screen......but there is the requried code you need in it.

Hope this helps......Oh! This bat will not run as is. It uses ansi, a mouse, sound and other space consumers. But the input and copy con are the code you need.

Peace, goodwill and happy computing.

World Library

cls
@echo off
ansi /slow
cls

:start
cls
type menu.doc
call getdate
echo %day% ÿ
echo %fulldate%

echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo ³ ENTER YOUR PASSWORD ³
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

echo  THIS COMPUTER IS PASSWORD PROTECTED.
echo  ÄÄÄÄÄÄÄÄPlease use your mouse.ÄÄÄÄÄÄÄÄÄ

mc /c5,3,18,5 20,3,32,5 32,3,42,5 43,3,50,5 50,3,69,5 19,7,59,9

if errorlevel 6 goto program
if errorlevel 5 goto stop1
if errorlevel 4 goto tips
if errorlevel 3 goto program
if errorlevel 2 goto view
if errorlevel 1 goto inst
if errorlevel 0 goto stop1



:stop1
goto stop

:inst
cls
echo ooo
CLS
edit instr1.doc
rem start /MAX notepad instr1.doc
goto START



:view
cls
echo ÿ ÿ
echo  PASSWORD ÿ
echo  **************************************
echo  Created by World Library. ÿ
echo  Registration policy. FREEWARE ÿ
echo  ÿ
echo 
echo  ÿ
echo  Bug reports=:-( wlibrary@gdi.net ÿ
echo  ÿ
echo  Snail mail.....next page 
echo 
ECHO  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO  º Next! º
ECHO  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ


mc /c43,20,59,22
if errorlevel 1 goto next

:next
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º World Library º
echo º Planet Earth º
echo º 11144 Batch File Lane º
echo º DOS Ville South Africa º
echo º º
echo º Thank You! º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo 

ECHO  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO  º A Go Back! º
ECHO  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO  º B Main Menu! º
ECHO  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ


mc /c43,17,58,19 43,20,58,22
if errorlevel 2 goto over
if errorlevel 1 goto back2

:back2
cls
goto view

:over
cls
type menu.doc
goto start


:program
type menu.doc
call getdate
echo %day% ÿ
echo %fulldate%
if not exist password.set goto nofile
echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo ³ Enter your P/W. Press F6 then ENTER ³
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

copy con password.dat > nul
copy password.set+password.dat password.bat > nul
call password
if not "%password%"=="dobe" goto badpassword

echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo ³ Valid Password has been entered. ³
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

goto done

:nofile
echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo ³Password.set missing (set password=^z) ³
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

echo Press a key to return to menu
pause > nul
goto start

:badpassword
plany god.wav
echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo ³Wrong Password. Contact systems Admin. ³
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
plany message.wav
echo Press a key to return to menu
pause > nul
goto start
:tips
echo  Always get the crack first.Then get the program.
echo  Be sure to read the FAGs for using Usnet. ÿ
echo  Wait two days before sending creeps a nasty gram.ÿ
echo  All of these files may be modified.
echo  The http:/***@*** in news readers are hot. 
echo  Just double click and go to http: site 
echo  Even though you have a crack, if the program 
echo  is a keeper register it. Without your support 
echo  whats the point of creating new or improving 
echo  existing programs. ÿ 
ECHO  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» 
ECHO  º Click to Clear º 
ECHO  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ 

mc /c45,17,72,19
if errorlevel 1 goto nix
:nix
type menu.doc
goto start

:done
set password=
del password.bat > nul
del password.dat > nul

:stop
:end
cls

ansi/u
echo this is where you place the command to continue


0

Response Number 4
Name: Chear Tze Jian
Date: June 18, 2000 at 17:09:02 Pacific
Reply:

Hey!If you wanted to do so,why don't you try
my way?Just do like this:
@echo off
:res
cls
if "%1"=="" goto help
if "%2"=="" goto help
Are you sure you want to copy %1 to %2?
choice /c:yn
if errorlevel 1 if not errorlevel 2 goto yes
if errorlevel 2 if not errorlevel 3 goto no
:yes
echo.
echo Be sure the source disk and target disk
echo is available.
echo.
pause
xcopy %1 %2
echo MISSION:COMPLETE (Muhahaha)
pause
goto end
:no
echo.
echo You have indicated that you don't want
echo to copy %1 to %2
echo Press any key to quit...
pause > nul
goto end
:help
echo.
echo Usage:
echo e.g.
echo jcopy c:\readme.txt a:\backup\abc.txt
:end
echo.
echo Bye!

[Save this thin' as jcopy.bat]
bye!
requirements:dos 6.0 or if you have that
choice program then lower than 6.0 also can.


0

Response Number 5
Name: bill
Date: September 1, 2000 at 03:49:11 Pacific
Reply:

i need help creating a password bat file so that my children can not get into or logon aol with my knowing about it. i also need to be able to change the password when needed.


0

Related Posts

See More



Response Number 6
Name: Jenny Hunter
Date: September 2, 2000 at 04:56:55 Pacific
Reply:

I try to put a final line in my batchfile to close ms-dos window,
it is:
exit
the all commands in the batch file execute OK,but the last line is not,
the word EXIT appear after C:\
and ms-dos window stop there it not close at all,
I have tried something like
c/s (for "close screen) but it doesn't help

I appreciate your help.
many thanks.


0

Response Number 7
Name: Dean
Date: October 9, 2000 at 11:59:59 Pacific
Reply:

Just the commad EXIT on the last line should work fine. It has worked in all my samples.


0

Response Number 8
Name: Justin Weaver
Date: November 19, 2000 at 13:10:52 Pacific
Reply:

HI
I AM TRYING TO CREATE A BATCH FILE TO LOOK AT THE TIME AND WHEN IT GETS TO A SPECIFIC TIME TO GO UNDER START AND SHUT DOWN THE COMPUTER. CAN YOU HELP ME CREATE ONE. THANKS.

JUSTIN WEAVER


0

Response Number 9
Name: Craig
Date: November 29, 2000 at 07:27:41 Pacific
Reply:

I also can not get the EXIT command to shut down the DOS window in Win98. I have found that it will work on NT, but it does not on Win98.


0

Sponsored Link
Ads by Google
Reply to Message Icon

How to install external c... Say Thank You



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch File: Commands/Prompts

Read batch file and write in a Text www.computing.net/answers/dos/read-batch-file-and-write-in-a-text/16653.html

Batch File.....CHOICE command in XP www.computing.net/answers/dos/batch-filechoice-command-in-xp/13909.html

Batch file commands? www.computing.net/answers/dos/batch-file-commands/2674.html