Web Development

General discussion


Need a simple BAT file, newbie question.

By m_sauga100 ·
I am a real novice at bat/pif file programming.

This is what I want.

Filename : sol.bat ( or sol.XXX) where xxx is some extension.

What the program should do....

1) Append the date and time sol.bat was executed to a file.

2) Run sol.exe (The solitaire program).

Yes I wnat to monitor an employee that is supposed to be working but instead is playing games.

I DO NOT WANT a sermon as to why or why not this is a good idea or a bad idea. I simply want help with this program.

Any replies highly appreciated.

Thanks in Advance.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by parier In reply to Need a simple BAT file, n ...

Cool, nice, I like you already.

Ok, lots of steps.

Send me an email and we can chat in yahoo or messenger, in the mean time, I will compose the explanation and post here - no_spam@eparisek.com

Collapse -

by m_sauga100 In reply to Need a simple BAT file, n ...

-- Hmm still havent gotten an answer... would dearly love one. Any help appreciated.

Collapse -

Simple solution

by Roger In reply to

First locate SOL.EXE and open the folder where it is located.

Second create a new file named SOL.BAT in the same folder that SOL.EXE is in. Place the following commands in SOL.BAT

@echo off
date >> sol.run < enter.txt
time >> sol.run < enter.txt

Next create a file named enter.txt as follows:

echo xx > enter.txt
debug enter.txt
e 100
0d 0a

NOTE: Press ENTER at the end of each line above!

Edit sol.bat and enter the following commands

@echo off > nul
date >> sol < enter.txt
time >> sol < enter.txt

Change all locations where sol.exe is executed (shortcuts and menu items) and change the exe to bat. (not the executable program, but the shortcuts that call the program.)

The enter.txt file will contain 5 characters. The first 2 are the hexadecimal characters OD OA (Carriage return and line feed.)

The sol.bat file will
1. turn off echo so the commands will not show on the screen. Be sure to put the @ immediately before echo with no spaces, then a single space and the word off. This will suppress the output of this line and all following lines.
2. Store the date in the sol file
3. Store the time in the sol file
4. execute the real sol.exe

It is critical that you change all menu items and desktop shortcuts so they point to sol.bat instead of sol.exe

The file (sol) that is created (or updated) will contain the following 4 lines:

The current date is: mm/dd/yyyy
Enter new date
The current time is: hh:mm:ss.mmm
Enter new time

These 4 lines will be appended to the end of the sol file each time the batch file is run (just before the soliaire game starts).

Hope this helps!


Related Discussions

Related Forums