Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

brunetmj

macrumors member
Original poster
Jul 9, 2010
67
0
Upstate, NY
I tried researching bat files but it got to complex for me

From my Windows XP desktop I want to be able to execute a bat file to open mytextfile.txt (located in the root directory) in notepad , keep it open for five minutes, close notepad and open the same text again 5 minutes later , indefinitely (until I stop the bat file manually)
 

iShater

macrumors 604
Aug 13, 2002
7,026
470
Chicagoland
The problem is going to be the closing of that file. You can have the batch file open notepad, but doing a close on it is not something native to DOS/CMD shell.

What is that you are trying to accomplish by doing all this? why do you need that file opened at those intervals? Maybe a batch file is not the best solution.

And by the way, the title is misleading, this is not a simple bat file ;)
 

chrmjenkins

macrumors 603
Oct 29, 2007
5,325
158
MD
The problem is going to be the closing of that file. You can have the batch file open notepad, but doing a close on it is not something native to DOS/CMD shell.

What is that you are trying to accomplish by doing all this? why do you need that file opened at those intervals? Maybe a batch file is not the best solution.

Honestly, it sounds like a prank to me.
 

brunetmj

macrumors member
Original poster
Jul 9, 2010
67
0
Upstate, NY
Honestly, it sounds like a prank to me.
This is not any kind of prank.
If you send me an email here I would be happy to explain in full.

Sorry if the title was misleading. Since i am a novice concering bat files I just assumed people with advanced computer skills might find it a relatively easy task.
I am simply trying to open and close a file at regular intervals. It could be an excel file or access or any other. Again this is a real need for a good reason.
I should have said open and close any kind of file automatically repeatedly
 

chrmjenkins

macrumors 603
Oct 29, 2007
5,325
158
MD
This is not any kind of prank.
If you send me an email here I would be happy to explain in full.

Sorry if the title was misleading. Since i am a novice concering bat files I just assumed people with advanced computer skills might find it a relatively easy task.
I am simply trying to open and close a file at regular intervals. It could be an excel file or access or any other. Again this is a real need for a good reason

I was not passing judgment. Pranks can be funny. I was simply stating that seemed like the most obvious use.
 

brunetmj

macrumors member
Original poster
Jul 9, 2010
67
0
Upstate, NY
I was not passing judgment. Pranks can be funny. I was simply stating that seemed like the most obvious use.

I took no offense to the prank statement
Since people are curious by nature and have good reasons to ask questions when trying to help someone I originally intended to post my reasons.I just thought at the last moment that it may not be a good idea. Again would be happy to explain in email
 

iShater

macrumors 604
Aug 13, 2002
7,026
470
Chicagoland
The plot thickens! :p


But an automation scripting tool would be better than bat. The closing part would not work.
 

brunetmj

macrumors member
Original poster
Jul 9, 2010
67
0
Upstate, NY
I would not be able to use third party software- only programs that typically comes with windows in a business environment.
This is not much of a plot. It just involves some knowledge of how companies work things these days with their computers combined with the fact I made the unfortunate choice of using most of my real name on this forum
 

iShater

macrumors 604
Aug 13, 2002
7,026
470
Chicagoland
Then my recommendation is to stop doing whatever it is you are doing at work. Not worth the risk. Having a script do something will be seen by someone that you trying to pull a fast one, whether pretending that windows are opening, that something is getting done, cleaning something up, etc.

My honest recommendation from a fellow corporate drone. :eek:

Besides, cannot be done in .bat, you need an application/tool to do what you are asking for it to do.
 

brunetmj

macrumors member
Original poster
Jul 9, 2010
67
0
Upstate, NY
Then my recommendation is to stop doing whatever it is you are doing at work. Not worth the risk.

After considering what you said i will heed your advice.
However this does not rule out mechanical interventions.
Does anyone know where I can get a vibrating mouse?;)

Just to clarify IT schemes to save money sometimes don't work well with how things get done in the real world. The fact is they are making multitasking almost impossible.
 

robvas

macrumors 68040
Mar 29, 2009
3,240
629
USA
You'd want to use Task Scheduler, this isn't 1994.

Actually, you'd want to use PowerShell, this isn't 1999.
 

brunetmj

macrumors member
Original poster
Jul 9, 2010
67
0
Upstate, NY
That's a very neat device. Unfortunatly IT strikes again.Any thing that you would put in your home computer gets encrypted before you can use it on my work computer.
It would wipe it clean. The hard drives and any cd's are also encrypted.
I was considering inventing a motorized pile driver
Put it next to the keyboard and a mechanical finger pushes a key and then raises at timed intervals :)
 

maflynn

macrumors Haswell
May 3, 2009
73,448
43,370
You need to use vbscript to start and possibly kill notepad. To be honest even then, I'm not sure its possible.

I've written my share of vbscripts and batch files and I can easily say that batch files can only do the most basic tasks. vbscripts give you more power and flexibility but the system shields you from doing some things.
 

brunetmj

macrumors member
Original poster
Jul 9, 2010
67
0
Upstate, NY
Thanks everyone. It may be easier to do something mechanical such as keep the mouse in motion and maybe less detectable by big brother.
 

maflynn

macrumors Haswell
May 3, 2009
73,448
43,370
If the intent of the script is to fool some monitoring software, I'm not sure a running script that starts/stops an application will do that.

some (most?) of those type of programs monitor keyboard (and possibly mouse) activity to see if the computer is being actively used, not whether an app is starting or stopping.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.