Jump to content

Problem with CPL command in Autoit


Recommended Posts

Hello,

i have following problem:

I want to run CPL commands in my autoit scripts, but if i run them in my script, i got error messages an after hitting on ok it executes anyway.

If i run in this command in the run box it works all fine: control.exe Mmsys.cpl,@0,1

This is what i tried in autoit:

Run("control.exe Mmsys.cpl,@0,1", @SystemDir)

Other things i tried are: _RunDos("control.exe Mmsys.cpl,@0,1")

Run(@ComSpec & " /c " & 'control.exe Mmsys.cpl,@0,1', "", @SW_HIDE)

and shellexecute

Nothing works good :P

I hope somebody knows how to fix that. :D

Link to comment
Share on other sites

Hello,

i have following problem:

I want to run CPL commands in my autoit scripts, but if i run them in my script, i got error messages an after hitting on ok it executes anyway.

If i run in this command in the run box it works all fine: control.exe Mmsys.cpl,@0,1

This is what i tried in autoit:

Run("control.exe Mmsys.cpl,@0,1", @SystemDir)

Other things i tried are: _RunDos("control.exe Mmsys.cpl,@0,1")

Run(@ComSpec & " /c " & 'control.exe Mmsys.cpl,@0,1', "", @SW_HIDE)

and shellexecute

Nothing works good :P

I hope somebody knows how to fix that. :D

that's strange it works for me fine.

try this: Run("RunDll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,@0,1")

Edited by erezlevi
Link to comment
Share on other sites

that's strange it works for me fine.

try this: Run("RunDll32.exe shell32.dll,Control_RunDLL Mmsys.cpl,@0,1")

I tried that, but same error.

I get a message like: The file MMDRIVER.INF needed for Driver installation was not found. The file is damaged or not in System32 folder. Copy the file from Windows disk one in your System32 folder.

Maybe its because im using Windows XP x64

But i run my script in x86 Mode :P

I tried to set following

Run("control.exe Mmsys.cpl,@0,1", @SystemDir)

and

Run("control.exe Mmsys.cpl,@0,1", @windowsdir & "\SYSWOW64")

and

Run("control.exe Mmsys.cpl,@0,1",@windowsdir & "\System32")

I get everytime that error ;)

Edit:

Ok, i got it working, but i dont know why i cant use it in 32bit mode :D

I installed autoit now in 64bit mode and if i run my script in 64bit mode it works...

Run("control.exe Mmsys.cpl,@0,1")

Is it a bug or can i only run my script in 64bit mode on x64 machines?

If that is the problem i have to make 2 versions of my program i think.

Edited by Matrix112
Link to comment
Share on other sites

Matrix112 - I just saw a shortcut on my desktop to Display Properties. That gave me the idea that you could do this:

Go to Start button > Control Panel > right-click the applet you want to be able to launch and send it to the Desktop to create a shortcut. Then just use the ShellExecute function to launch it. If you need to include and install the shortcut, you can just use the FileInstall function.

Das Häschen benutzt Radar

Link to comment
Share on other sites

Hello,

i have following problem:

I want to run CPL commands in my autoit scripts, but if i run them in my script, i got error messages an after hitting on ok it executes anyway.

If i run in this command in the run box it works all fine: control.exe Mmsys.cpl,@0,1

This is what i tried in autoit:

Run("control.exe Mmsys.cpl,@0,1", @SystemDir)

Other things i tried are: _RunDos("control.exe Mmsys.cpl,@0,1")

Run(@ComSpec & " /c " & 'control.exe Mmsys.cpl,@0,1', "", @SW_HIDE)

and shellexecute

Nothing works good :P

I hope somebody knows how to fix that. :D

Try using the full paths

Run(@SystemDir & "\control.exe " & @SystemDir & "\Mmsys.cpl,@0,1", @SystemDir)

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

Try using the full paths

Run(@SystemDir & "\control.exe " & @SystemDir & "\Mmsys.cpl,@0,1", @SystemDir)
The Problem is solved, but i tried your tip. It gives me the same error message. It seems to be a bug in wow64 redirection system or maybe in autoit x86.

If i run my script in x64 mode all works correct, I only get this error in x86 mode. :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...