Tech Support Forum banner
Status
Not open for further replies.
1 - 5 of 5 Posts

·
Registered
Joined
·
6 Posts
Discussion Starter · #1 ·
Hi
In XP home to run a certain app I need to disable direct draw acceleration,

I currently do it as per below

start>run>type 'dxdiag', go to display tab & disable directdraw

This is too long, does anyone know a shortuct or code for a batch file to disable this, and as importantly, enable it after I have finished with the app?
 

·
Microsoft MVP
Joined
·
3,339 Posts
Copy the following code and paste it into notepad.
Save it as SetDx.cmd someplace, say C:\Scripts
You can use any name and folder.

Create a shortcut to the file and place it on the desktop.
Name this shortcut Enable Acceleration
Create a copy of the shortcut, then name the copy Disable Acceleration
Right click the Disable Acceleration shortcut, click Properties.
In the Target: box, add Disable to the end of the command line, preceded by a space.
So with the above path/filename, it will look like this:
Code:
"C:\Scripts\SetDx.cmd" Disable
Set the Run: drop down to Minimized
Click OK
Right click the Enable Acceleration shortcut, click Properties
Set the Run: box in the Enable Acceleration shortcut to Minimized as well.
No need to change the Target: box, but you can add Enable at the end if you wish.

Code:
@Echo Off
::Set Mode=1 to Disable, Mode=0 to Enable as the default if nothing specified on the command line.
Set _Mode=0
If /I "%~1"=="Disable" Set _Mode=1
If /I "%~1"=="Enable" Set _Mode=0
Reg Add HKLM\SOFTWARE\Microsoft\DirectDraw /V EmulationOnly /T REG_DWORD /D %_Mode% /F
Reg Add HKLM\SOFTWARE\Microsoft\Direct3D\Drivers /V SoftwareOnly /T REG_DWORD /D %_Mode% /F
This can also be set as a toggle, one icon that will toggle the state, but you would need to press a key to close the message window.

The only testing I've done is to confirm that DxDiag reports Direct Draw Acceleration and Direct3D Acceleration as Enabled or Disabled in a VPC 2007 Virtual Machine running XP Pro SP3 and on a Dell Dimension 9100 running XP MCE 2005, with an ATI Radeon x300 series card.
 

·
Microsoft MVP
Joined
·
3,339 Posts
Code:
@Echo Off
Title "Toggling DX Mode"
Mode CON: COLS=35 Lines=5
Reg query HKLM\SOFTWARE\Microsoft\DirectDraw|Findstr /I "emulationonly">Nul
If %Errorlevel%==1 (Set _CurMode=0x0)&Goto _Test
For /F "Tokens=3 skip=3" %%I In ('Reg query HKLM\SOFTWARE\Microsoft\DirectDraw /V EmulationOnly') Do Set _CurMode=%%I
:_Test
If %_CurMode%==0x0 (Set _Setting=Disable) Else (Set _Setting=Enable)
::Set Mode=1 to Disable, Mode=0 to Enable
Set _Mode=0
If /I "%_Setting%"=="Disable" Set _Mode=1
If /I "%_Setting%"=="Enable" Set _Mode=0
Reg Add HKLM\SOFTWARE\Microsoft\DirectDraw /V EmulationOnly /T REG_DWORD /D %_Mode% /F>Nul
Reg Add HKLM\SOFTWARE\Microsoft\Direct3D\Drivers /V SoftwareOnly /T REG_DWORD /D %_Mode% /F>Nul
Echo Acceleration has been %_Setting%d
Ping 1.0.0.0 -n 1 -w 5000>Nul
You can adjust the width (COLS=) and height (Lines=) of the window
The length of time can be changed by adjusting the number after -w
It's in milliseconds, so 5000 is 5 seconds.

To set the position on the screen, add a Pause statement at the end of the file.
Run the program.
Position the window where you want it
Right click the Title bar of the Window and click Properties
Click the Layout tab
Uncheck the box for Let system position window.
Click OK
Select Save properties for future windows with same title
Click OK
Remove the Pause statement.

If you don't need the message telling you what mode was set, delete the last two lines.
 
1 - 5 of 5 Posts
Status
Not open for further replies.
Top