|
|
|
#1 (permalink) | |||||||||||||
|
Intel Overclocker
![]() |
I am trying to make a batch file which asks the user to enter a file name and some text and is saves it in a .txt file. I can make the file and have words in it, but i do not know how to let the user choose the filename through use of a variable, or enter their words also through a variable. This is a school project, so any help is greatly appreciated. here is what i have
ECHO Enter the name of the file: rem here is where i want to retrieve inputed data and store it the variable "Filename" ECHO Enter the data you want in your text file: rem here is where i want to retrieve data and store it in a variable "words" ECHO Words>>C:\files\filename.txt
__________________
For Sale: UD3p | e8600 | Corsair DDR2 | p4 LGA 774 3.0ghz SIIG Bit Perfect Sound Card
|
|||||||||||||
|
|
|
|
|
#2 (permalink) | ||||||||||||||
|
Linux Lobbyist
![]() |
Give me a minute. Plus bumbzors.
__________________
Quote:
|
||||||||||||||
|
|
|
|
|
#3 (permalink) | ||||||||||||||
|
Linux Lobbyist
![]() |
Code:
SET /P file=Choose Name: SET /P location=Choose Location: CD %location% MKDIR %file% That just makes a file! Let me fix it.
__________________
Quote:
Last edited by GodofGrunts : 12-19-08 at 11:44 AM |
||||||||||||||
|
|
|
|
|
#4 (permalink) | ||||||||||||||
|
.
![]() |
Quote:
Code:
@echo off SET /P file=Choose Name: SET /P text=Enter Text to be added to file: echo %text%>>%file%
__________________
Imaging with Windows PE Please keep the OCN Terms of Service in mind when posting.
Last edited by BiG O : 12-19-08 at 11:57 AM |
||||||||||||||
|
|
|
|
#5 (permalink) | ||||||||||||||
|
Linux Lobbyist
![]() |
Code:
@echo off SET /P file=Choose Name: SET /P location=Choose Location: SET /P info=Insert what you would like in the file: CD %location% ECHO %info% > %file%.txt ECHO The file can be found at %location% SET /P seepath= EXIT
__________________
Quote:
Last edited by GodofGrunts : 12-19-08 at 12:02 PM |
||||||||||||||
|
|
|
|
|
#6 (permalink) | |||||||||||||||
|
Linux Lobbyist
![]() |
Quote:
I like mine though.
__________________
Quote:
|
|||||||||||||||
|
|
|
|
|
#7 (permalink) | |||||||||||||
|
.
![]() |
That's unnecessary. You can just put pause there. Otherwise, it's fine. Pretty much the same as mine.
__________________
Imaging with Windows PE Please keep the OCN Terms of Service in mind when posting.
|
|||||||||||||
|
|
|
|
#8 (permalink) | ||||||||||||||
|
Linux Lobbyist
![]() |
oh yeah pause... I've been programming in python and bash for the past 4 or 5 months. That was just a quick fix.
__________________
Quote:
|
||||||||||||||
|
|
|
|
|
#9 (permalink) | |||||||||||||
|
The Game
![]() |
yeah, when you have used Python or even Bash, Batch scripting seems nigh-on hellish. Just no tools at your disposal.
__________________
Lattyware | Main (Sig) Rig: gBOX42 | Lan Rig: gLAN42 Never been convinced by Linux? Here is a challenge. | Using LVM Scratched Disc? | Guide To LAN Parties | Writing a GUI application in Python/Glade Etching an image into your case. | Wireless Access Points: Easy wireless networking. A Member Of The OCN Anime/Manga Club "I disapprove of what you say, but I will defend to the death your right to say it." --Evelyn Beatrice Hall
|
|||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|