| | |
Echo >> problem
![]() |
Sorry about the second thread, I forgot to include this on my first one.
Anyways, is it possible for someone to use the "echo %text here% >> %location of file here%" command to save some text to a file in a different folder? I did it, but got a message saying "access denied". I say someone do it with this code:
echo %finalmsg% >> \\BAS-307-15\mikchat\public.txt
But when I do it, for example:
echo %text% >> C:\Documents and Settings\Owner\Desktop\log.txt
It doesn't work! Anyone know whats going on?
Anyways, is it possible for someone to use the "echo %text here% >> %location of file here%" command to save some text to a file in a different folder? I did it, but got a message saying "access denied". I say someone do it with this code:
echo %finalmsg% >> \\BAS-307-15\mikchat\public.txt
But when I do it, for example:
echo %text% >> C:\Documents and Settings\Owner\Desktop\log.txt
It doesn't work! Anyone know whats going on?
Well the problem with using
I would recommend that you use variables because you can define them at the top of the your code and change their value all throughout the code by simply changing them in one place, e.g.,:
Using that method, all you have to do is make the change in the variable at the top and it is modified all throughout the program.
echo %text% >> C:\Documents and Settings\Owner\Desktop\log.txt is that the C:\Documents and Settings\Owner\Desktop\log.txt needs to be in quotes.I would recommend that you use variables because you can define them at the top of the your code and change their value all throughout the code by simply changing them in one place, e.g.,:
set TEXT="Some Text" set MYLOG="C:\Documents and Settings\%USERNAME%\Desktop\log.txt" :: Or your can use this method as well :: :: set MYLOG="%USERPROFILE%\Desktop\log.txt" :: :: That is the way that I setup a poorman's alias/macro :: list for my CMD Sessions. That way each user on the :: computer will have their own set of aliases/macros. echo "%text%" >> "%mylog%" type "%mylog%"
Using that method, all you have to do is make the change in the variable at the top and it is modified all throughout the program.
![]() |
Similar Threads
- FTP problem (PHP)
- problem in setting session (PHP)
- Learning PHP but problem with script (PHP)
- need help with order problem (PHP)
- Problem with variables in Windows shell script (Windows NT / 2000 / XP)
- Bridge.dll Problem (Viruses, Spyware and other Nasties)
- search and results problem (PHP)
- Code Problem (PHP)
- Problem with foreach when using linking (PHP)
- Large Array Problem (PHP)
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: Batch File...please help!!
- Next Thread: Need to send Cntrl +C to an Running Exe using a DOS batch File.
| Thread Tools | Search this Thread |





