๒๘/๑๑/๕๐

Pervasive SQL and transaction durability risks.

Solution Details

Solution ID: 00014597
What is Transaction Durability and what is the risk of turning it off?

Problem Description:

Problem Environment:
Pervasive.SQL 2000 Pervasive.SQL v7

Cause of this problem:
Solution Notes:
A Transaction-Durable file is a 6.x file with a unique key or a 7.x file with a unique key or system data defined, and which was not opened in Accelerated mode.

If the Microkernel Database Engine (MKDE) Transaction Durability option is set to YES and the file is Transaction-Durable, then the MKDE returns the status to the application after committing (saving) the entire transaction to the transaction log file. The MKDE does this when it encounters the end of the transaction, such as an End Transaction, or an Abort Transaction operation. That means, non-transaction operations, i.e., Btrieve operations not enclosed within a Begin Transaction and an End Transaction (or an Abort Transaction) operation are not durable.

If the Microkernel Database Engine (MKDE) Transaction Durability option is set to NO and the file is not Transaction-Durable, then the MKDE returns and the status to the application before committing (saving) the entire transaction.

Not durable means the application may receive a successful status for the ransaction or non-transaction operation, but there is a window in which a system failure may cause the operation to be lost because it was not yet written to the data file, although it may still be present in the system cache.

Hence, if the user wants the non-transaction operations to be durable, the operations should be placed within transactions and Transaction Durability set to YES.





จากคำอธิบายข้างต้นจะเห็นว่า ข้อมูลที่ถูก update โดยไม่มีการใส่ BEGIN - END transaction ครอบเอาไว้ อาจเป็นอันตรายข้อมูลหายได้ ถึงแม้ว่าโปรแกรมจะได้รับ status=0 กลับมาจาก database engine ก็ตาม ตามรูปซึ่ง dump มาจาก log file จะเห็นว่า ตรงบรรทัดที่ 2692 เป็นการ update Inv.BTR ที่อยู่ภายในกรอบของ BEGIN - END หลังจากนั้น บรรทัดที่ 2694 มีการสั่ง update Inv.BTR อีกครั้ง ซึ่งตรงกับคำอธิบายว่าเป็น Not durable ตรงจุดนี้เป็นจุดแรกที่เกิดความเสี่ยงข้อมูลหาย

๒๔/๑๑/๕๐

Antivirus may cause Pervasive SQL status 85

Solution Details

Solution ID: 00016378
Intermittent Status 85

Problem Description:
Status code 85: "The File is Locked" is returned to different workstations without any pattern.

Problem Environment:
Pervasive SQL

Cause of this problem:
A Status Code 85 occurs when the file is closed because Anti-Virus software opens and locks the file to scan causing the next database operation to fail.

Solution Notes:
Set the Anti-Virus software to not scan Pervasive SQL data files. Consult your Anti-Virus software manual for instructions on how to exclude files


http://www.pervasive.com/kb/kb.asp?fx=getdetails&solid=00016378&title=Intermittent%20Status%2085

จำได้ว่ากรณีนี้เคยเจอตั้งแต่สมัยที่ computer ช้ามากๆ ทำให้ Antivirus scan ไฟล์ไม่จบ ยิ่งไฟล์ database ใหญ่มากๆ ยิ่งใช้เวลาในการ scan นาน ขณะเดียวกันถ้า application มีการเปิด-ปิดไฟล์บ่อยๆ ก็เป็นการ trigger ให้ตัว antivirus ทำการ scan ไฟล์บ่อย ซึ่งกรณีนี้อาจเกิดขึ้นกับ server ที่บังเอิญมี load เยอะๆ ก็ได้ ...

Delay effect with Pervasive.SQL client cache engine

Solution Details

Solution ID: 00016865
What is the Client Cache engine ?

Problem Description:

Problem Environment:
Pervasive.SQL V8

Cause of this problem:

Solution Notes:
The client cache engine is essentially a MicroKernel database engine that stores recently-used data file pages in local memory on the client workstation. Future reads will access the client cache first prior to sending a request across the network to re-read the records. This can yield significant increases in performance as it reduces the data flowing across the network (network traffic). However, the data that is stored in the client cache is static data, and is refreshed after a maximum of every 5 seconds delay by default.

In some environments, the application behavior cannot tolerate this delay, and the client cache engine should be disabled. Also, in other environments where there are a very large number of clients connected to the server the polling between the client and the server can increase the network traffic and actually reduce performance.

Other factors such as application architecture can make a tremendous difference in the ability of the client cache engine to be used efficiently.
For transactional API applications the client cache engine is bypassed in the following circumstances:

  • q Opens / Closes / Resets - are processed both locally and passed through to the server engine
  • q Insert / Update / Delete (any write operation) is passed through to the server engine q Anything inside a transaction is passed through to the server engine
  • q Any operation with a lock bias is passed through to the server engine The relational API is client / server in nature and all processing is performed at the server. As such the client cache engine is not used for SQL / ODBC access.

For more information on the Client Cache Engine, consult the " What's New..." and the "Advanced Operations Guide" on-line manuals which are available with the Pervasive.SQL V8 documentation.


http://www.pervasive.com/kb/kb.asp?fx=getdetails&solid=00016865&title=What%20is%20the%20Client%20Cache%20engine

จากคำอธิบายเกี่ยวกับ cache engine ของ Pervasive 8 จะเห็นว่า ข้อดีของ cache engine คือ ลดปริมาณ traffic ใน network ลง ทำให้การทำงานเร็วขึ้น แต่ก็จะมีปัญหา delay ของข้อมูล เมื่อคอมพิวเตอร์เครื่องหนึ่ง update ข้อมูลไปแล้ว กว่าที่คอมพิวเตอร์อีกเครื่องหนึ่งจะทำการ refresh cache engine จะต้องรอทุกๆ 5 วินาที แต่เท่าที่ผ่านมา ปัญหานี้ยังไม่ถูกสังเกตพบจนกลายเป็นปัญหาจากผู้ใช้ครับ

๒๒/๑๑/๕๐

Pervasive v10 deprecated features

Netware
NetWare is no longer a supported platform for Pervasive PSQL. If you are running a previous version of Pervasive PSQL for NetWare, consider upgrading to Pervasive PSQL for Windows or for Linux.

Windows NT/98/ME
The following Windows platforms are no longer supported for any of the Pervasive SQL products:
  • Windows NTWindows
  • 98/ME

DOS 6.22
DOS 6.22 is no longer PSQL products.

16-bit Applications
Support is no longer available for 16-bit products or 16-bit application development with Pervasive PSQL. The 16-bit utilities are no longer available in Pervasive PSQL, nor are the 16-bit client components. The configuration settings for 16-bit clients, such as Use Thunk and so forth, are no longer available.

DOS TSR Programs
The DOS Terminate and Stay Resident (TSR) programs are no
longer supported. This includes the following programs:

  • BREQUEST DOS
  • requester BREQNT
  • DOS requester BREQTCP DOS requester Sockets.exe

Note that the DOS requester btrbox is still supported on 32-bit Windows platforms. DOS applications are not supported on 64-bit Windows platforms; therefore, btrbox is not supported on 64-bit Windows platforms.



เป็นอันว่า ทั้ง Netware Server, Windows 9x/Me/NT นั้นถูกทิ้งเรียบร้อย แต่ดูเหมือนว่า โปรแกรม SCRAFT ของเรายังคงใช้ BtrBox สำหรับ version 32-bit ได้ สำหรับ PSQL10 คงต้องรอทดสอบกันต่อไป

๑๗/๑๑/๕๐

uDOS project for testing

uDOS is a free operating system built on the FreeDOS kernel with DJGPP. uDOS
provides an integrated suite of features inluding Perl, Python, etc., as well as
a Watt-32 based networking environment and ELF library support. Can be run live
from CD image.


For testing only friend, current status is "Pre-Alpha".

http://sourceforge.net/projects/udos/

๑๒/๑๑/๕๐

Pervasive SQL & DOS application on Vista solution

Recently test my DOS accounting program with Vista.

Problem when running with old Btrieve.EXE :
It can run smoothly except the program reports e memory free is 38x KB, not enough to call the subprocess.

Problem when runnig with Pervasive SQL 8.x :
The program show error status code 20 (the database engine not install) .

now I got a good news from Pervasive.

http://www.pervasive.com/kb/kb.asp?fx=getdetails&solid=00017909&title=DOS%20application%20returns%20a%20Status%2020%20on%20Windows%20Vista

Solution Details
Solution ID: 00017909

DOS application returns a Status 20 on Windows Vista
Problem Description:
DOS application returns a Status 20.


Problem Environment:
Pervasive PSQL v9
Windows Vista


Cause of this problem:
With Windows Vista, Pervasive Software is no longer able to support applications that require the use of a T.S.R. (Terminate Stay Ready) Requester, this includes such Btrieve Requesters as Brequest, Breqtcp, Breqnt, etc. Windows Vista users can use the Pervasive provided Win32 DOS Box Support, which is a VXD (Virtual eXtended Driver) that comes with Pervasive PSQL v9. This VXD gets loaded as part of the operating system boot-up, however, since Windows Vista limits the location where applications can place files, users are required to perform additional steps to make this program execute.


Solution Notes:
Configuring BTRBOX to work with Windows Vista:

1. Copy the following file (from the \pvsw\bin directory) into the \windows\system32\ directory:
BTRVDD.DLL

๖/๑๑/๕๐

DOS printing with USB printer

(ดูภาษาไทย พิมพ์ DOS ด้วยเครื่องพิมพ์ USB)

Most DOS programs use parallel port (LPT1:, LPT2: LPT3:) for printing only, can not support other port type as USB port (some new laser printers) or serial port (some model of POS printers). Although those printers can understand DOS printing commands.

In Windows we will make use of network redirector ability, capturing data from parallel port and send it to the network printer. A DOS program still prints to parallel port as usual, but all data will redirect to prefer network printer (include the network printer that directly connected at the machine).

There are 2 easy steps:
1. Setting the network printer by sharing the printer.
2. Capture parallel port and redirect to the network printer.

Setting the network printer.
If your computer has a valid network connection, simply share the printer. If your computer does not have any valid connection, you need to create a fake connection by adding loop back adapter.

Adding Microsoft loop back adapter
For standalone computer, Windows does not allow sharing the printer without a network connection. You can install the Loop Back Adapter to create network connection connects to itself.



> From Control Panel select "Add Hardware".
> Click Next at first page of wizard.
> Select "Yes", then click Next.
> Scroll down and select "Add a new hardware device" then click Next.
> Select "Install the hardware that I manually...", then click Next.
> Select "Network adapters" then click Next.
> Select "Microsoft" -> "Microsoft loop back adapter" then click Next.
> And Next, Next, ... until finish.

Don't forget to assign the IP address for loop back connection you created.
> In Control Panel select "Network Connections".
> Right click at the connection then select "Properties".
> Double click at "Internet protocol (TCP/IP)".
> Select choice "Use the following IP address".
> Fill a valid IP address number with sub net as 192.168.1.100 / 255.255.255.0

Sharing the printer
> In Control Panels select Printers and Faxes,
> then right click at the printer you want to share.
> Select Sharing in context menu.



> In printer properties page select Share this printer
> named your share printer for easy to remember.

Capture parallel port and redirect to the network printer.
Open Command Prompt window by doing this.
> From menu Start -> select Run -> type CMD in Open box.



In Command Prompt window
> Check the computer name by typing command
net view
> Check the printer name by typing
net view \\computername
> Redirect parellel port to network printer by typing
net use lpt1: \\computername\printername /persistence:yes

พิมพ์ DOS ด้วยเครื่องพิมพ์ USB

โปรแกรม DOS ส่วนใหญ่มักพิมพ์ออกทาง parallel port (LPT1:,LPT2:, LPT3:) ทำให้ไม่สามารถใช้กับเครื่องพิมพ์ที่เชื่อมต่อทางอื่น เช่น USB port (เครื่องพิมพ์ laser รุ่นใหม่ๆ)หรือ serial port (เครื่องพิมพ์สลิป POS - Point Of Sale) ถึงแม้ว่าเครื่องพิมพ์เหล่านั้น สามารถรับคำสั่งพิมพ์จาก DOS เหมือนกับเครื่องพิมพ์ parallel port ทั่วไป

ภายใต้ Windows เราสามารถใช้ประโยชน์จาก network redirector เพื่อดักข้อมูลที่ส่งพิมพ์ออกทาง parallel port ให้เปลี่ยนไปออกทาง network printer ที่เรากำหนด ด้วยวิธีนี้ ถึงแม้ว่า โปรแกรม DOS ยังคงส่งข้อมูลออกทาง parallel port เหมือนเดิม แต่ข้อมูลที่ส่งออกไป จะถูกเปลี่ยนทางให้ไปออกที่ network printer รวมถึง network printer
ต่อกับเครื่องคอมพิวเตอร์ตัวเองด้วย

ขั้นตอนการทำมี 2 ขั้นตอนง่าย ๆ ดังนี้
1. ตั้งเครื่องพิมพ์ที่ต่ออยู่ให้กลายเป็น network printer
2. ดักข้อมูลที่ออกทาง parallel port ให้ไปออกที่ network printer แทน

ตั้งเครื่องพิมพ์ให้กลายเป็น network printer
สำหรับคอมพิวเตอร์ที่ไม่มีการเชื่อมต่อ network ไม่สามารถตั้ง network printer ได้ เนื่องจากไม่มี network connection เราต้องติดตั้ง Loop Back Adapter เพื่อสร้างการเชื่อมต่อ network ภายในเครื่องเดียวกันเอง เพื่อให้ Windows ยอมให้เราตั้ง network printer

ติดตั้ง Microsoft loop back adapter
ถ้าคอมพิวเตอร์ของคุณมี network connection อยู่แล้ว คุณเพียงสั่งแชร์เครื่องพิมพ์ แต่ถ้าคอมพิวเตอร์ของคุณไม่มี connection คุณต้องสร้าง connection หลอกขึ้นมา โดยติดตั้ง loop back adapter



> ใน Control Panel เลือก Add Hardware เลือก Next
> ที่หน้าแรกของ wizard เลือก Yes แล้ว กด Next
> เลื่อนลงมาที่รายการด้านล่าง เลือก "Add a new hardware device" แล้วกด Next
> เลือก "Install the hardware that I manually..." แล้วกด Next
> เลือก "Network adapters" แล้วกด Next
> เลือก "Microsoft" -> "Microsoft loop back adapter" แล้วกด Next
> กด Next ต่อไปเรื่อยๆ จนเสร็จ

กำหนด IP address สำหรับ loop back connction ที่คุณสร้างขึ้นมา
> ใน Control Panel เลือก "Network Connections"
> ใช้เมาส์ปุ่มขวาที่ชื่อ connection นั้น แล้วเลือก "Properties"
> ดับเบิลคลิกที่ "Internet protocol (TCP/IP)"
> เลือกหัวข้อ "Use the following IP address"
> ใส่หมายเลข IP adress และ sub net เช่น 192.168.1.100 / 255.255.255.0

การแชร์เครื่องพิมพ์
> ใน Control Panels เปิด Printers and Faxes
> แล้วกดเมาส์ปุ่มขวาตรงเครื่องพิมพ์ ที่คุณต้องการ เลือก Sharing จากเมนู



> ในหน้า Printer properties ให้เลือก Share this printer
> ตั้งชื่อเรียก network printer นั้น ให้จดจำได้ง่าย

ดักข้อมูลที่ parallel port ให้ไปออกที่ network printer แทน

เปิดหน้าต่าง Command Prompt ดังนี้
> จากเมนู Start -> เลือก Run -> พิมพ์ CMD ลงในกล่อง Open



ในหน้าต่าง Command Prompt
> ดูชื่อคอมพิวเตอร์ โดยใช้คำสั่ง
net view
> ดูชื่อเครื่องพิมพ์ โดยใช้คำสั่ง
net view \\ชื่อคอมพิวเตอร์
> เปลี่ยนทางข้อมูลของ parallel port ไปที่ network printer โดยใช้คำสั่ง
net use lpt1: \\ชื่อคอมพิวเตอร์\ชื่อเครื่องพิมพ์ /persistent:yes


Some useful links
Microsoft NET service command
HOWTO: Print to a USB Printer from DOS in Windows XP
Printing from DOS with Windows 2000 or XP

๕/๑๑/๕๐

How to make DOS programs printing faster in Windows

ทำอย่างไรให้โปรแกรม DOS ภายใต้ Windows พิมพ์ได้เร็วขึ้น


Introduction: This article explains how to speed up printing from DOS to a DOS compatible printer on Windows.If you need to print from DOS to a Windows printer which is not DOS compatible, like a Windows-Only (GDI) USB printer or a virtual printer (WinFax, PDF writers, etc.), please see: How to print from DOS to Windows-Only printers.

บทความนี้ อธิบายวิธีที่ทำให้การพิมพ์จากโปรแกรม DOS ใน Windows ไปยังเครื่องพิมพ์ที่สามารถรับคำสั่ง DOS ได้โดยตรง ถ้าคุณต้องการพิมพ์จาก DOS ไปยังเครื่องพิมพ์ที่รับคำสั๋ง Windows อย่างเดียว เช่น GDI USB printer (inkjet printer) หรือ เครื่องพิมพ์เสมือนบน Windows เช่น WixFax, PDF writers จะต้องไปดูเรื่องของ วิธีการสั่งพิมพ์จาก DOS ไปยังเครื่องพิมพ์ของ Windows

The Problem: If you run a DOS application on NT-based Windows systems (Windows 2000, XP, 2003, Vista), you may find that your print jobs are spooled after many seconds, sometimes minutes, especially when printing to a network printer. It may even happen on Windows 95/98/ME machines.

ถ้าคุณใช้โปรแกรม DOS ภายใต้ระบบ Windows แบบ NT เช่น Windows 2000, XP, 2003, Vista มักมีปัญหาคือ เมื่อสั่งพิมพ์งานออกไปแล้ว จะต้องรออีกหลายวินาที บางครั้งอาจนานเป็นนาที โดยเฉพาะเมื่อส่งพิมพ์ไปยัง network printer บางครั้งปัญหานี้ ก็เกิดขึ้นเมื่อทำงานภายใต้ Windows 95/98/ME ด้วย

The problem has two main causes:
ปัญหาเกิดขึ้นจาก 2 สาเหตุ

  1. How the DOS program manages the printing device
    วิธีที่โปรแกรม DOS จัดการเครื่องพิมพ์
  2. How the DOS program uses the CPU on the machine
    วิธีที่โปรแกรม DOS ใช้ขีดความสามารถของ CPU

Managing the DOS printing device
การจัดการเครื่องพิมพ์ของ DOS

In the age of DOS, most of the printers were dot-matrix and connected to a parallel port (LPT1:, LPT2: or LPT3:)

ในยุคของ DOS เครื่องพิมพ์ส่วนใหญ่ เป็นแบบ dot-matrix
และต่อผ่าน parrallel port (LPT1:, LPT2: หรือ LPT3:)

A typical DOS program sends binary data (characters) to one of these ports (usually LPT1:). A dot matrix printer can start printing that data as soon as it's sent to the port and before all the data has been sent by the program.
โปรแกรมบน DOS ส่วนใหญ่ ข้อมูลตัวอักษรออกทาง port เหล่านี้ (มักจะใช้ LPT1:) และเครื่องพิมพ์ dot-matrix สามารถเริ่มพิมพ์ข้อมูลทันที ที่ได้รับข้อมูลทาง port นั้น โดยไม่ต้องรอให้โปรแกรมส่งข้อมูลที่จะพิมพ์จบ

A DOS programmer did not need to close the printing device (port) when the print job ended, because the printer had already finished its job.

ดังนั้นโปรแกรมเมอร์ที่เขียนโปรแกรมสมัยนั้น จึงไม่จำเป็น ส่งคำสั่งปิดงานพิมพ์ไปยังเครื่องพิมพ์ เมื่อส่งข้อมูลจบ

Under Windows things are different. Laser and other graphical printers need to receive an entire page before rendering it on paper. Additionally, multiple applications running/printing on the same machine introduced the need for a printing queue, especially with network printers.
So, if the DOS program does not close the printer port at the print job end, then Windows does not know the job is really finished. It waits for a timeout value to expire before deciding to finally spool the next job.
แต่เมื่อเราใช้งานภายใต้ Windows ผลที่ได้กลับแตกต่างออกไป
เพราะเครื่องพิมพ์เลเซอร์ และเครื่องพิมพ์ graphic จะเริ่มพิมพ์ต่อเมื่อได้รับข้อมูลครบหน้ากระดาษ ยิ่งไปกว่านั้นโปรแกรมบน Windows หลายตัวที่กำลังทำงานอยู่และต้องการพิมพ์ ก็ต้องใช้งานผ่าน print queue โดยเฉพาะเวลาส่งพิมพ์ไปยัง network printers ถ้าโปรแกรมบน DOS ไม่ส่งคำสั่งปิด printer port เมื่อจบงาน Windows ก็ไม่สามารถทราบได้ว่างานพิมพ์นั้นจบหรือยัง มันจะต้องรอรับข้อมูลที่โปรแกรม DOS ส่งมาพิมพ์ต่อไปอีกระยะหนึ่ง จนครบเวลา timeout ที่ตั้งเอาไว้ จึงปิดงานพิมพ์ของโปรแกรม DOS นั้น

If you're in this situation, you can close the DOS program as soon as it finishes printing. You'll see your print job start immediately because all the DOS handles will be closed by the Operating System itself, including the printer port.

ถ้าคุณเคยเจอปัญหาอย่างนี้ คุณสามารถสั่งปิดโปรแกรม DOS หลังจากที่โปรแกรมส่งข้อมูลที่จะพิมพ์จบแล้ว เพื่อให้เครื่องพิมพ์เริ่มพิมพ์ทันที เนื่องจาก port เครื่องพิมพ์บน DOS ถูกปิดอัตโนมัติเมื่อเราปิดโปรแกรม DOS

The best solution for this problem should be to fix the DOS program, if you are the original programmer. In further articles I'll show you how to do this with popular DOS programming languages, like Basic and Clipper.

การแก้ปัญหาดีที่สุดคือ แก้โปรแกรม DOS ถ้าคุณเป็นผู้เขียนโปรแกรมนั้นเอง แต่ถ้าคุณไม่สามารถแก้ไขโปรแกรมได้ ก็คงต้องแก้ปัญหาโดยวิธีอื่น ตามที่จะแนะนำต่อไป

If you're not a programmer, you can change the Windows timer above, to make the delay shorter. Do not set the value too low or the printer could start printing before the DOS program has really finished creating the job.

ถ้าคุณไม่ใช่โปรแกรมเมอร์ คุณสามารถตั้งค่า timeout ใหม่ ให้น้อยกว่าเดิม แต่ต้องระวังอย่าตั้งค่าน้อยเกินไป จนเครื่องพิมพ์เริ่มพิมพ์ก่อนที่โปรแกรมจะส่งงานพิมพ์นั้นออกไปเสร็จ

1) If you're running an NT based Windows system (2000, XP, Vista)
The timeout value is stored into a Registry entry. TAKE CARE using RegEdit. It could be rather dangerous. If you'll perform the wrong actions, your machine could even refuse to reboot.

สำหรับ Windows ที่ใช้ระบบ NT (2000,XP,Vista) ค่า timeout อยู่ใน Registry เราต้องใช้คำสั่ง RegEdit ระวัง ถ้าคุณเข้าไปแก้ไขผิดที่ อาจทำให้เครื่องคอมพิวเตอร์ของคุณ ไม่สามารถทำงานได้เมื่อ restart ใหม่
  • In REGEDIT ( START -> RUN -> REGEDIT )
    click :
    HKey_Local_Machine
    then click :
    System
    then click :
    CurrentControlSet
    then click :
    Control
    then click : WOW
Here you'll find the LPT_timeout property. Double clicking the value you can choose how many seconds you prefer, then reboot your machine to apply the change.
เมื่อเปิดเข้าไปใน WOW คุณจะเห็นชื่อ LPT_timeout ให้ double click ตรงค่าของมัน เพื่อเข้าไปแก้ให้เป็นค่าวินาที ที่ต้องการ เมื่อแก้ไขเสร็จแล้ว คุณต้องสั่ง restart เครื่องเพื่อให้ Windows ใช้ค่าที่กำหนดใหม่นั้น

2) If you're runnign an older Windows OS (9x/ME)
Search your C drive for the SYSTEM.INI file and open it with NOTEPAD (don't use Ms-Word or other word processors). In the [386enh] section search [Network] if it does not exist enter the following:

ถ้าคุณใช้ Windows รุ่นเก่า (9x/ME) ให้ใช้โปรแกรม NOTEPAD เปิดไฟล์ที่ชื่อ SYSTEM.INI ที่อยู่ใน drive C แล้วค้นหา บรรทัดที่มีคำว่า [386enh] แล้วหาบรรทัด [Network] ที่อยู่ภายใต้มัน หรือถ้าไม่พบ ให้เพิ่มบรรทัดตามตัวอย่างต่อไปนี้ลงไป
  • [Network]
    PrintBufTime=10
    [IFSMGR]
    PrintBufTime=10

This will set the timeout to 10 seconds. Reboot your machine to apply the changes.

คำสั่งนี้ เป็นการตั้งค่า timeout เท่ากับ 10 วินาที เสร็จแล้วให้ restart เครื่องเพื่อให้ Windows ใช้ค่าที่ตั้งใหม่ในการทำงาน
DOS CPU usage
การใช้ขีดความสามารถ CPU ของ DOS

Unlike Windows, MS-DOS was a single-user operating system. You could only run a single program at a time, which could even keep the entire CPU for itself, to work as fast as possible.
This causes a common problem for DOS programs running on recent Windows machines: the CPU hogging.
ข้อแตกต่างระหว่าง Windows กับ DOS คือ DOS สามารถเรียกโปรแกรมใช้งานทีละโปรแกรม ดังนั้น DOS จึงใช้ขีดความสามารถทั้งหมดของ CPU เพื่อให้ทำงานได้เร็วที่สุด และนี่คือปัญหาที่ทำให้โปรแกรมบน DOS หลายตัวเมื่อนำมาใช้งานภายใต้ Windows จะเกิดปัญหา การทำงานสะดุด ไม่ลื่นไหลเหมือนกับการทำงานบน DOS
Typically, when polling the keyboard (during a wait state), the DOS program performs an infinite loop, to check it as fast as possible. In DOS this did not cause any troubles at all, but on Windows, the system might be so "busy" that no other tasks can be performed (including the print spooling process, which usually starts when the DOS program has finished printing and is waiting for user input, typically on a menu).
กล่าวคือ ในระหว่างที่รอรับการกด keyboard จากผู้ใช้ โปรแกรมบน DOS จะวนรอเพื่อตรวจสอบการกด keyboard ตลอดเวลา แต่สำหรับใน Windows การทำงานดังกล่าว มีผลให้ระบบ ไม่สามารถแบ่งเวลาของ CPU ระหว่างที่รอรับ keyboard ไปให้โปรแกรมหรือการทำงานอื่นๆ ที่รออยู่ รวมทั้ง print spooler ของ Windows ที่รับข้อมูลจากโปรแกรม DOS มาส่งพิมพ์ ก็ไม่สามารถทำการประมวลผลได้เช่นกัน

To check if your own DOS program is actually hogging the CPU, please try to leave the Task Manager opened while it's on execution.

การตรวจสอบว่าโปรแกรม DOS นั้นกินเวลาของ CPU มากแค่ไหน สามารถดูได้จาก Task Manager ระหว่างที่เรียกใช้โปรแกรม DOS นั้น ดังนี้
  • Press CTRL+ALT+DEL
    Click the "Performance" tab

If the CPU usage often go to 100 percent while using your DOS program, then you're experiencing this problem.

ถ้าการทำงานของ CPU ขึ้นเป็น 100% ระหว่างที่เรียกใช้โปรแกรม DOS แสดงว่าเกิดปัญหานี้ขึ้นแล้ว
A DOS programmer cannot do much for this problem because the keyboard polling routine is usually implemented in a low level routine inside the DOS compiler itself. Fortunately some patches has been released for popular DOS compilers to include a "release CPU" command inside that loop.
สำหร้บโปรแกรมเมอร์ผู้เขียนโปรแกรม DOS เอง สามารถแก้ปัญหานี้ได้ง่ายกว่า โดยการปรับโปรแกรมในส่วนของ loop ที่รอรับ keyboard หรือถ้าสามารถ compile โปรแกรมใหม่ โดยใช้ compiler รุ่นใหม่ ที่มี option ที่สั่งให้ release CPU ภายใน loop รอรับ keyboard ให้เลือกอยู่แล้ว ก็เพียงแค่สั่ง compile โปรแกรมใหม่เท่านั้น
You can find some of the DOS 100% CPU patches at the Citrix website.
If the solutions in the page above does not apply to you, you may want to try TameDOS as a replacement for the Windows Command Prompt, which is supposed to solve this problem.
คุณสามารถหาโปรแกรมเล็ก ๆ ที่ใช้แก้ปัญหา 100% CPU จากเว็บของ Citrix หรืออาจลองใช้โปรแกรม TameDOS แทน Windows Command Prompt เดิมก็ได้

original article http://www.amazines.com/Software/article_detail.cfm/329253?articleid=329253

Google