»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 10-13-2003, 08:16 PM   #1 (permalink)
Registered User
 
Join Date: Oct 2003
Posts: 3
Crackerjack is on a distinguished road
Batch File Help

Working on a batch file that will do backups for me and I came across a problem that I couldn't figure out. I know how to create a batch file that will do backups with a pre-set source and destination folder, but I was wondering how to make one that will prompt the user for the source destination and target destination instead. Any suggestions would be helpul.

Crackerjack is offline   Reply With Quote
Old 10-13-2003, 08:21 PM   #2 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
There's an app in the win2k resource kit called 'choice.exe' which will allow you to put in questions for user interaction.

Realize though, they won't exactly have a pretty GUI to point a directory too. Not sure what type of users this is for... but chances are the user will just hit return to get rid of it. If its non technical users I doubt they'd know how to decide if they want it to to go to C:\Backup or whatever.

Welcome to TechIMO
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Old 10-13-2003, 09:46 PM   #3 (permalink)
Registered User
 
Join Date: Oct 2003
Posts: 3
Crackerjack is on a distinguished road
Thanks for the welcome vass0922.

I'm not worried about having a pretty GUI at all. Im going to be the only one using it so if I just have to type in the whole directory that would be fine. I was wondering if there was just some coding I could type in for the prompt instead of having to use something like 'choice.exe'. If that is the only option, then I will go ahead and explore it more. Thanks for the reply.
Crackerjack is offline   Reply With Quote
Old 10-13-2003, 10:04 PM   #4 (permalink)
Registered User
 
OuTpaTienT's Avatar
 
Join Date: Oct 2001
Location: Bay Area, CA USA
Posts: 6,966
OuTpaTienT is on a distinguished road
Send a message via ICQ to OuTpaTienT
What OS are you running?


http://www.robvanderwoude.com/userinput.html


and this is nifty for NT:
http://www.jsiinc.com/SUBA/tip0300/rh0323.htm
OuTpaTienT is offline   Reply With Quote
Old 10-13-2003, 10:24 PM   #5 (permalink)
Registered User
 
Join Date: Oct 2001
Posts: 6,533
John Prophet is on a distinguished road
A recent thread about backup batch files http://www.techimo.com/forum/showthr...threadid=74342

As you see, Im not the expert, lol.

I would think about looking at xcopy's options, or "switches" some of them, like /y /w or /p prompt for user interaction

JP
__________________
"Even a fool is thought to be wise if he is silent"
John Prophet is offline   Reply With Quote
Old 10-13-2003, 11:10 PM   #6 (permalink)
Registered User
 
Join Date: Oct 2003
Posts: 3
Crackerjack is on a distinguished road
Im currently running Windows XP Prof.

I tried using the copy con from the link provided but keep getting an error stating "cannot perform a cyclic copy". Im not sure why I keep getting that error even though I read the reasons why it may occur. I'm going to post a bit of what I was playing around with and see if anyone can gather anything from it. Im trying to keep it fairly simple, but it seems that I wont be able to for much longer .



@echo off

REM Create backup copy of a foler, including all files in subfolders

echo Please provide the source folder:

COPY CON source

echo Please provide the destination folder:

COPY CON destination

XCOPY source destination /D /E

pause



I also read the other thread but they were dealing with a pre-determined source and destination.
Crackerjack is offline   Reply With Quote
Old 10-14-2003, 08:01 AM   #7 (permalink)
Registered User
 
meese's Avatar
 
Join Date: Jun 2003
Location: NJ
Posts: 1,096
meese is on a distinguished road
Cj,

The COPY CON command just takes input from the keyboard and sticks it into a file. Type the following at the command prompt and press ENTER:

COPY CON Diskinfo.bat

Then type the following while pressing ENTER after each:

VOL
CHKDSK
PAUSE
DIR
PAUSE

Then press F6 and then ENTER.

Now type Diskinfo at the command prompt.

You basically created a batch file on the fly that is stored at c:\. If you go there you will see a file called Diskinfo.bat.

You cannot do what you are trying to do with this command.

Check c:\ after you run your program. You will find two FILES not DIRECTORIES that were created. The COPY CON will only create files.

Last edited by meese; 10-14-2003 at 08:22 AM.
meese is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 06:28 AM.