ZTree.com  | ZEN  | About...  

 Index   Back

[OT] Echo ON or OFF to a text file   [OT]

By: Ben Kent       
Date: Sep 28,2012 at 14:34
In Response to: [OT] Echo ON or OFF to a text file (Alan Smedley)

> I have built a switch box that controls the power to a device
> attached to my Linux Server. We have developing an application that
> controls the power switch by monitoring the date, time and content of a
> particular file looking for any change from ON to OFF or a resend of ON
> to cause a reset if the device has locked up.
>
> I need to do this remotely as the switch box controls part of my VoIP
> service which can occasionally lock up.
>
> My plan was to log into any one of my Windows systems and using
> ZtreeWIN, ECHO the file change to the monitored file on the server.
>
> I have now realize that the "ECHO ON" and "ECHO OFF" are internal to
> the internal to ECHO when used in a Batch file or on the Command line so
> all an "ECHO ON>T:\XXX\state.txt" does is wipe out the existing state.txt
> file.
>
> Is there a way around this at the command line.
>
> Thanks
>
> Alan Smedley

1. Use some other text as Livi suggests

2. Create files that have the required content and copy instead of echo i.e.
copy /y on.txt T:\XXX\state.txt

3. Use some other command to write the text to the console, for example
c:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe echo ON

Ben

1,095 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 79 users online (0 registered, 79 guests)
Index | Admin contact |   Forum Time: Mar 29, 2024 - 6:50 am UTC  |  Hits:62,395,786  (10,572 Today )
RSS Feed