Batch File Help

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
hart2179
Posts: 2
Joined: 07 Dec 2014 08:08

Batch File Help

#1 Post by hart2179 » 07 Dec 2014 08:16

Hi im now to creating batch files and have created one and it work :)

but once i have hit enter and the answer it saves the file in my C:\ which is what i want but when i run it again and enter the required details manually it then overwrite the orignal file i want to keep them all if possible ?

any ideas

Code: Select all

@echo off
color a
title Call logging :details:
cls
echo Please Enter All The Below Details !!!VITAL TO CALL!!!!
echo Please hit enter to load Magic
pause
cd c:\users\hart5294
start magic.bat
echo.
echo.
cd "C:\users\hart\logged"
set /p user id=User ID:
set /p asset=Asset:
set /p tel=Tel:
set /p location=Location:
set /p error=Error:
echo Error=%error% User=%user id% Asset=%asset% Tel=%tel% Location=%location%>logged.txt
echo.
echo.
echo.
echo Loading.....
echo.
echo.
pause


Mod edit: The # icon in the editor will put code tags around the selected text, to make it clear where code is.


hart2179
Posts: 2
Joined: 07 Dec 2014 08:08

Re: Batch File Help

#3 Post by hart2179 » 07 Dec 2014 11:33

Thank you but i am still unable to get it to work, can you possibly adjust the batch file below to make it work ??? :)

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: Batch File Help

#4 Post by Squashman » 07 Dec 2014 14:57

command >> file Append standard output of command to file

Every example in the link I gave you shows TWO >> for appending to a file.

ShadowThief
Expert
Posts: 1160
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Batch File Help

#5 Post by ShadowThief » 07 Dec 2014 18:16

Do you want to create a different file every time you run the script or do you want the details to be added to the end of logged.txt every time you run the script?

Post Reply