473,796 Members | 2,911 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

command output to text issue

1 New Member
Hi,

Small question here I have created a bat file which allows a user to enter numerous values which are substituted into a command line query, the results of which are outputted to a text file ie:

set /p qry=what time would you like to meet:

%qry% > C:\currenttime. txt

I have created a much longer query which has several variables entered into it. The script works fine. I would like to output the customised command to another text file for future use/reference. Unfortunately the following command doesnt work understandably:

echo %qry% > C:\currenttime. txt > C:\template.txt

I only recieve: %qry% in a text file. How can I make sure the text file contains the full customised command: %qry% > C:\currenttime. txt only.

Kind regards,

663jiffy
Jan 29 '08 #1
1 1348
Banfa
9,065 Recognized Expert Moderator Expert
Try

echo %qry% ^> C:\currenttime. txt > C:\template.txt

In this case ^ is the escape character for the command prompt allowing characters after it to be treated literally
Jan 31 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
7671
by: René | last post by:
Hello group, I have a question about a script i use. The function of the script is to dynamically write an ftp script and execute this with dos ftp.exe . This script always worked on a Windows 2000 pro workstation. Now i have moved it to a Windows XP pro workstation it writes the ftp command file but the command doesn't execute anymore. I've tried everything I could think of but no result at all. Could someone please help me with this or...
3
4426
by: Steve | last post by:
How can I read the output from a command line utility such as ping, nslookup, etc, from within my app??? I know that it is possible to output the results to a text file using the > function in a command window and then read the file, but doing this for 1000+ files will cause a lot of unnecessary read/writes to the disc and affect performance... I am not asking for a .NET way to ping or do a DNS lookup, I am interested in the concept of...
8
35044
by: zhiwei wang | last post by:
I remember that there is a function that could invoke shell command such as "rm" "cp", directly in .c file. But I could not recall its name, and I googled with nothing meaningful. I vaguely remember it is like: foo("cp file1 file2"); it is that simple, but cant remember. Could anyone here give me a clue?
2
5873
by: Adam Clauss | last post by:
I am building a GUI to wrap around some of the information/abilities contained within the program netsh. I have figured out how to use redirect the standardinput and standardoutput so that I can read/write from my application. The "easy" way to do this would be to spawn an instance of netsh everytime I need to execute a command, write the command to the input (including a quit command), and call ReadToEnd on the output. And this does...
9
19742
by: shank | last post by:
What is the proper syntax to run this command line in ASP? wzzip.exe File.zip File.txt thanks
2
3386
by: Jim | last post by:
Hello, I need a program that will traverse a directory tree to ensure that there are unix-style line endings on every file in that tree that is a text file. To tell text files from others I want to use the unix "file" command (Python's "mimetypes" is not so good for me). But I am stuck on something about getting that output, and I'd greatly appreciate any pointers.
5
1682
by: qazwart | last post by:
I am reading from a "cvs rlog" command, and I need both the STDOUT and STDERR. Unfortunately, something very strange is happening. If I do this: $cmd = "$cvs_cmd -q rlog -NS -r$from_label::$to_label neo 2>&1"; // Hard coded module DEBUG ("if (!($cvs_fh = popen(\"$cmd\", 'r'))) {"); if (!($cvs_fh = popen("$cmd", 'r'))) { generate_error("Canot open command \"$cmd\" for reading"); }
2
2802
by: yogeshbhandare | last post by:
Hi Friends I have an issue with shell_exec. I am trying evoke a command from browser. The command get executed properly without any issue however it deos not return all the output which is shown on when I try to execute the same command in the DOS shell. The details are as follows : When I execute that command the output seen in dos shell is @(#) International Ispell Version 3.1.20 (but really Aspell 0.50.3) & gest...
4
7455
by: Keith Hughitt | last post by:
Hi all, I am using someone else's script which expects input in the form of: ./script.py <arg1arg2 I was wondering if the angle-brackets here have a special meaning? It seems like they specify an input and output stream to use in place of the console. I could not
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.