![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Vista Ultimate x64 | Batch file Problem Hey all I just wanted to know if its possible to make a batch file that when run, constantly saves everything that you type in a certain file like Work.txt Theoretically it should probably be something like: @echo off CLS :A somehowsave work.txt GOTO :A I know it probably not possible but any help will be appreciated |
My System Specs![]() |
| | #2 (permalink) |
| Win7x64 | Re: Batch file Problem Short answer: No. Use an editor that supports periodic saves, like Word. ================================================ Longer answer: yes, but it's probably impractical for your purposes. The act of "saving" is specific to the editor which has the text file open for editing. Say for example that it's Notepad.exe in your case. The next version of the question thus becomes: "How can I make Notepad save periodically?" Since Notepad is not exactly modular or expandable, you'd have to figure out a way of leveraging the in-buit functionality to periodically save a file. For example, there's a Ctrl+S keystroke accelerator under the Notepad "File" menu. Next version of the question: "How can I make Notepad believe that Ctrl+S is being pressed periodically?" If you can code, one way to do that is to write a utility that would figure out the window handle (HWND) of the Notepad instance in question, and then send it WM_KEYDOWN messages whose wParam maps to "Ctrl+S". In pseudocode: - figure out parent window HWND for Notepad instance. LOOP: - SendMessage( hwnd, WM_KEYDOWN, "Ctrl+S", NULL ) - break if done - Sleep( <some interval> ) - Goto LOOP It's definitely doable and not that tricky if you've done old-style Win32 UI programming, but it's almost certainly a misguided thing to do in the presence of better options - use Word |
My System Specs![]() |
| | #3 (permalink) |
| Vista Ultimate x64 | Re: Batch file Problem Ok, thanks a lot for your help |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Batch file problem | VB Script | |||
| Batch file help | General Discussion | |||
| Batch-file not working: PATH-problem? | Vista General | |||
| vista batch file problem | Vista General | |||
| batch file calling exe file problem | Vista security | |||