1. Choice
http://furies.senecac.on.ca/~cpang/ios100/bat_help.htm#choice gives the help for choice
http://www.techiwarehouse.com/cms/engine.php?page_id=9f59e25f gives some explanation
http://www.techiwarehouse.com/cms/engine.php?page_id=8dc6cfa1 gives an example
2. Editing
It's difficult or impossible to do the editing in batch. Why not use a workaround? Replace the file with an empty file (one of 0 bytes) and let the program append to that. That really is quite the same as having it create a new one. If this isn't what you need, please explain the problem in stead of asking for an impossible solution.
Kees
Hi.
I'm new to batch files, and have delved rather deep (for me anyway)
I have created a batch file that so far.
Will connect to remote DOS console, and execute a deletion of a set .txt file.
it first identifies the size of the file, and then asked if you wish to delete it.
advisory notes are to delete the file if over 5mb.
if user selects no, then batch closed with message not deleted.
if user selects yes, then batch file will delete the said file.
after this I then need it to alter a .ini file to read AppendToLog=0 (originally set to value 1)
I don't know of any way to do this other than sending the file to the c drive then copying the file to the DIR to overwrite the original.
I can only connect to the remote computer DOS prompt by an existing .exe file.
batch looks a little like.
=====================
@echo off
rem %1 = remote machine name/ip
rem %2 = users logon id
rem /r:1 = is switch built into remote dos command exe
brcmd \\%1 /r:1 "dir c:\docume~1\%2\applic~1\micros~1\intern~1\brndlog.txt"
echo Delete file if over 5,000,000 bytes.
choice Delete file
***unsure of rest of choice command ***
***cant remember - I don't really ***
***understand it - explanation would ***
***be good! ***
if not %errorlevel% neq 2 goto choiceno
:choiceyes
brcmd \\%1 /r:1 "del c:\docume~1\%2\applic~1\micros~1\intern~1\brndlog.txt" "xcopy \\rbkegcmpfs02\slss\hda\servic~1\brutil~1\brndlog.ini c:\docume~1\%2\applic~1\micros~1\intern~1\"
rem \\rbkegcmpfs02 = file server
*** this returns "access denied" as user I'm executing command from doesn't have network admin rights that I do***
:choiceno
echo you selected not to deleting file
:end
echo on
=================
So I need preferably to be able to edit the file through a batch file.
==============================
breakdown of things i need help with.
1.)
explanation as to how the CHOICE command works, and an example (i have it working but I don't understand how it does.)
2.)
how can I edit a file through a batch?
ie edit file called brndlog.ini which contents reads "AppendToLog=1"
to make it read "AppendToLog=0"
3.)
Any other ideas?

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic