loading
If you're interesting in coding or batch scripting, check out my latest Ible here.

Your eyes are very important. Screw with your vision and it’ll screw with you. We live in a world of close-up work, and our eyes don’t like it.
 
Our eyes work like any other muscle, changing shape to perform a task; they exist in a round shape when focusing far away, and they become egg-shaped when focusing up close. And like any other muscle, they can develop fatigue, glitches, and problems. The eyes’ natural state is the round long-distance lense, but when your eyes focus on anything you can touch for too long, too often, they forget how to relax back into that round shape. They remain in the egg shape, causing near-sightedness.
 
Our eyes are designed for ten minutes of close-work at a time, at most. Going longer causes cramping and near-sightedness. However, this doesn’t mean you can’t read for more than ten minutes. To avoid cramping, fatigue, and other problems, look away every ten minutes and fix your eyes on something far away. Every half-hour, you should get up and stretch your entire body. Allowing your eyes to rest for a few seconds (You hear that? Seconds. No long break, just ten seconds or so is all your eyes need to relax.) every ten minutes will help your eyes stay healthy and your vision to stay clear.
 
Remembering to look away from the computer every ten minutes just doesn’t happen. You can set a timer, but after a while you forget to reset the timer. I came across a program at a health and fitness Giveaway that displayed a little window every ten minutes, reminding you to look up. As good as the idea was, however, the program wasn’t very well-designed. It was glitchy and took up a lot of memory. I liked the idea, however, and have written my own version using batch and VBS. My little program runs well and is easy to set up, and will help keep your eyes happy.
 
This may seem like a long –Ible, but the content is very simple and short. Case-in-point, I tend to be wordy and florid with my speech, and as I write the way I speak, my instructions can be a little lengthy and confusing. Anyone who has seen my –Ibles on hiding data (https://www.instructables.com/id/A_Few_Ways_To_Hide_Data_On_A_Computer/) and getting free media (https://www.instructables.com/id/El-Mano8217s-Official-Guide-To-Free-Media/)  may know what I’m talking about (I’m working on the Free-Media guide, for anyone who’s actually seen it, and I have more to add to it.) This Instructible is 6 steps long in order to make the instructions simple for anyone not familiar with scripting. Just follow the directions and look at the pictures, and you can easily set the program up.

I've entered this in the Humana Health By Design contest. If you like my work, my -Ible, or me in general, please vote for me.

Step 1: The Setup

First, you need a folder to put the program in. Any folder will do, but all three files must be in the same directory (folder). I went to Program Files (My Computer, C:\, also called Master Drive, Program Files), and created a folder (Right-Click, Create New, Folder, give the folder a name) I named the folder ‘Eye Doctor’. Remember what folder you picked.

Step 2: The Timer

Copy everything between the horizontal dotted-lines, and paste it into NotePad (START, Programs, Accessories, NotePad. You need to be using an Administrator account to create this program. Non-Administrator won't save the files). Only the text between the lines, and not the lines themselves.

-------------------------------------------------------------------
set shell = CreateObject("WScript.Shell")
wscript.sleep 900000
shell.run "Screen.bat"
-------------------------------------------------------------------

Click ‘File’, ‘Save As’. A little box will pop up. In the top bar, navigate to your folder, in this case ‘C:\Program Files\Eye Doctor’. In the bottom of the box, where it says “File Name”, type

 

Timer.vbs

 

You must put it exactly like that, including the capital. “Timer.vbs”. Underneath File Name, Change “Save As Type” From “Text File” to “All Files”. Then click “Save”. Simple enough?

Step 3: The Second Timer

Again, copy everything between the horizontal dotted-lines, and paste it into NotePad.

----------------------------------------------------------------------------
set shell = CreateObject("WScript.Shell")
wscript.sleep 15000
shell.sendkeys "fine"
shell.sendkeys "{ENTER}"
----------------------------------------------------------------------------

Go to “Save As” and return to your folder (The nav-bar will probably already be in your folder). Under File Name, type

 

Stretch.vbs

 

Again, it must be exact, capitals and all. Change the file type to “All Files”, and you should see a little icon for Timer.vbs appear below the navigation bar. Hit Save, and you’re halfway done.

Step 4: The Screen

A third time, copy everything between the horizontal dotted-lines, and paste it into NotePad.

---------------------------------------------------------------------------------------------------------------
@echo off
color 0a
title Your Personal Optometrist
start Stretch.vbs
:Loop
cls
set continue=no
echo.
echo.
echo.
echo.
echo          Look at something in the distance until this screen closes,
echo.
echo.
echo                           or we will find you!
echo.
echo.
echo.
set/p continue=  
if %continue%==fine goto Fine
goto Loop
:Fine
start Timer.vbs
exit
---------------------------------------------------------------------------------------------------------------


Hit Save As, go to your folder and save the file as

 

Screen.bat

 

Be sure to get the “.bat” correct. Change 'Save File As' (Now you see icons for both “Timer.vbs” and “Stretch.vbs” under the nav-bar), and hit Save. You’re done scripting.

Step 5: The Switches: Activating the Program

One final time, copy the text between the lines into NotePad.


----------------------------------------------------------------
@echo off
title Eye Doctor Switch
color 0a
if EXIST Eye_Doctor_Is_On.dat goto Off
echo Running>Eye_Doctor_Is_On.dat
cd C:\Program Files\Eye Doctor
start Timer.vbs
echo.
echo.
echo             Eye Doctor Is Running...
echo.
pause
exit
:Off
taskkill /f /im wscript.exe >nul
del "Eye_Doctor_Is_On.dat"
echo.
echo.
echo              Eye Doctor Is Off...
echo.
pause
exit
----------------------------------------------------------------

This file will be named

Eye Switch.bat

There are two places you can save this file:
 

If you want to activate the program and let it run until you shut it off, save Eye Switch.bat to the same folder as the others, C:\Program Files\Eye Doctor. Right-Click on Eye Switch and click on “Create Shortcut”. Drag and drop or cut and paste this new icon to wherever you want your on/off button to stay. To start Eye Doctor, double-click the icon. To shut it off again, activate the icon a second time.

 

If you want to have an indicator on your computer that the program is running, save the file to your Desktop; you still name it

 

Eye Switch.bat

 

Now, to start Eye Doctor, click on Eye Switch.bat. A blank file will appear on the Desktop named

 

Eye_Doctor_Is_On

 

Activate Eye Switch.bat a second time; “Eye_Doctor_Is_On” will disappear, and Eye Doctor will shut off. In short, if there is a file on your Desktop named “Eye_Doctor_Is_On”, Eye Doctor is running.

 

* If you click on Switch.bat to start Eye Doctor and the "Eye Doctor Is Off" window appears, perhaps displaying the message "Cannot find wscript.exe. Process does not exist.", click Eye Switch again. This means that you forgot to turn Eye Doctor off when you shut off the computer and the program couldn’t reset itself.

Step 6: Technical

Advanced users, you can probably find some program that will provide a better on/off switch then batch. For Windows XP, you can paste a shortcut to Eye Switch, or even Timer, into Startup.

 

Also, my knowledge of VBS is almost non-existent. Thank you, iRule, for your “Self-Writing Shutdown, https://www.instructables.com/id/VBS_Shutdown/, which I have adjusted many a time to create programs. If anyone knows a better way to script the VBS programs, please post.

 

Please leave any questions, comments, or ideas, as I do read them, and I try to keep things up-to-date.

******************************

E Mano:


Build your own Command Prompt

How to hide Computer Files from the Technically Illiterate

This simple health switch will Keep you Warm

Wreak Havok with this simple Computer Virus


******************************

<p>Cool, this help because I'm near sighted. <br>Thanks for the awesome code!</p>
Keep in mind that you are excluding newer versions of Windows. In Windows 7, the batch file does not have that icon, it's a grey gear in a white box. Also, you should add a tip saying to run Notepad as administrator (right click, Run as Administrator) to avoid a saving error, since Program Files is a system directory. And furthermore, there IS NO startup directory in Vista and Windows 7. Instead of excluding these users, which many people, you need to include a workaround. Mine is using 3rd party software to modify the Registry. I use Glary Utilities to do this. Download and install it from (www.glaryutilities.com) and go to the Modules tab. Then go to the optimize and improve tab on the side, and click Startup Manager. This lists all your entries, to add a new one click Add program. . ., name it Eye Doctor, and copy the path (if you followed the suggested path it's C:\Program Files\Eye Doctor\Timer.vbs) and click OK. The program works on XP too, but your method doesn't work on Vista or 7.<br /> Please watch out for this in your future instructables. Compatibility is very important.<br /> Ryan<br />
I apologize but know GU doesn't open VBS files in the browsing, only Windows files such as .exe, .com, or .bat files. To get it to work, under the File Name box in Files of type:, you have to open the drop-down menu and select All Files. Then select Timer.vbs and click OK.<br /> <br /> Also, a suggestion, you should have a UI on this thing. The VBS file's great, but you should at least have a taskbar icon. Otherwise your user has no way of seeing the status of the program, the option of closing it without removing it from Startup and restarting, or even the option of knowing if it's running. I can't check for compatibility with Windows 7 without waiting however long it takes. It needs some work.<br /> <br /> Thanks,<br /> Ryan<br />
Yes, it had bugs. That's what I love about people. They're so quick to judge; put anything on the web, and you get free proof-reading. Never be afraid to post a rough-ish draft. Anyway, not having an on/off button was annoying. I have several nice screensavers and a fifteen-minute monitor shutoff in action. Everytime the program went off, it exited the screensaver and forestalled the power-saving shutoff. I added a userface, if you count &quot;Eye Doctor is on. Press any key to continue...&quot;, and there's now an indicator for those who want it. I don't know how you'd create a taskbar icon, unless you simply mean a shortcut to the new Eye Switch, which is the user's job. I'm not sure what you mean with GU. I only have Windows XP, so if it's a Vista or 7 thing, I can't do much.
The page might not be deleting because of the comments we put on it. GU (Glary Utilities) works on all 3 OSs and maybe more, so don't worry about compatibility there. Thanks for the support.<br /> Ryan<br />
OK, thanks for fixing the stuff. GU is my acronym for Glary Utilities, which I mentioned in the previous comment. Also, here is my revised code, titled &quot;main.bat&quot;, but you'll have to create pause.vbs which pauses for 15 seconds and idle.vbs which pauses for 10 minutes. There, of course, are some bugs in my code, like executing the vbs files, which I haven't created yet, but I'm working on it. Feel free to use it:<br /> http://www.projectbicara.com/main.bat<br /> The domain I posted it on is an incomplete project, especially since all I have up as of now is a modified Arduino schematic, but you can take a look. I plan to greatly expand it soon.<br /> Thanks for fixing the stuff, and good luck!<br /> Ryan<br />
Very nice modification, and an ingenious way to go about it, too. I would have never thought of the way you resolved the issue. However, (I know, more criticism :P) what happened to Startup? For that, i recommend putting back what you originally had (at least part of it) on the next page, and looking at Glary Utilities.<br /> Thanks for the support, hope you win!<br /> Ryan<br />
thanks for some great info!<br /> &quot;Workrave&quot; ( http://workrave.org ) is a great (and free/open source) program that helps eyes and hands :) (and its avaible for all major platforms)<br />

About This Instructable

3,473views

7favorites

License:

More by El Mano:Connect To Google Public DNS On Linux Mint Make A Joule Thief Coil Without A Ferrite Toroid Creating A Pixel Screen In Batch 
Add instructable to: