?
Solved

How to add string to the end of the file in batch scripting

Posted on 2006-10-27
6
Medium Priority
?
554 Views
Last Modified: 2007-12-19
Hello experts,

I need to add string to the file from  batch script. The string is: cmd /c > filename

echo cmd /c > filename >> c:\temp\abcd.txt

But it is failed on symbol >

Please help
0
Comment
Question by:IKeystone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 6

Accepted Solution

by:
SCDMETA earned 1000 total points
ID: 17822950
Escape the > with a carrat ^

echo cmd /c ^> test >> test.txt
0
 
LVL 15

Expert Comment

by:Ralf Klatt
ID: 17822982
Hi,

You might try:

echo cmd /c filename>>c:\temp\abcd.txt


Best regards,
Raisor
0
 
LVL 9

Expert Comment

by:shinobun
ID: 17823942
echo "cmd /c > filename" >> c:\temp\abcd.txt
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 4

Expert Comment

by:chhokra_expert
ID: 17824276
like shinobun said
 echo "cmd /c > filename" >> c:\temp\abcd.txt
will add the test "cmd /c > filename" to the end of the file.

but more importantly, what's that you are trying to do? the output of comand "cmd /c" will be redirected directed to filename but isn't "cmd /c" used to execute a command? i don't see that as part of your string. as it stands, it will probably just add a blank line to your file (whenever that command gets run). is this what you wanted to do?
0
 

Author Comment

by:IKeystone
ID: 17824290
Thanks Raisor.

With symbol ^ everything work fine

0
 

Author Comment

by:IKeystone
ID: 17824292
Sorry, Thanks SCDMETA !!!!!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Progress

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question