Solved

How to run osk.exe in Windows\System32 folder

Posted on 2014-09-24
7
2,743 Views
Last Modified: 2014-09-26
Hi experts,

I have a problem of not being able to execute osk.exe in the Windows\System32 folder (from my VB6 app).

If I copy osk.exe to my App folder and execute it (programmatically using CreateProcess or Shell) then all's good but I'd rather not do that because that means I'll either need to copy it from the target Windows folder to my App folder at install time (which I may have problems anyway) or I'd need to supply it as part of install but I should really be using the app that is appropriate for the target environment rather than one that I supply.

Any help would be appreciated.

Thanks,
Mike
0
Comment
Question by:gem56
  • 4
  • 3
7 Comments
 
LVL 69

Expert Comment

by:Qlemo
ID: 40341220
What's the issue with calling osk from System32? It should just work.
0
 

Author Comment

by:gem56
ID: 40341449
When I execute Shell("C:\Windows\system32\osk.exe", vbNormalFocus) I get the following message "Could not start On-SCreen keyboard".
0
 
LVL 69

Accepted Solution

by:
Qlemo earned 500 total points
ID: 40342341
That seems to happen on 64bit OS, when used in a 32bit app. The reason is that it starts the 32bit OSK (in C:\Windows\SysWoW64) instead of the required 64bit one. OSK starts, and then has issues with the OS.

You can check if there is a C:\Windows\SysNative (better %SystemRoot%\SysNative) folder - then use that one. If that folder is not found, use System32 instead.
0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

Author Comment

by:gem56
ID: 40343318
Hi Qlemo,

Thanks for that but it still does the same thing although it works OK on my colleagues PC. I created a new project and added only about 6-7 lines of code and get that error (on Win 7) but on two Win 8 PC's it works OK so I guess it must be something to do with my PC.

Thanks
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 40344018
Try manually to cross-check: Start Explorer, go to SysWOW64 and start OSK => error. Start from System32, and it works. SysNative is System32 on x64.
0
 

Author Comment

by:gem56
ID: 40346232
Hi Qlemo,

I tried both of those and there's no problems running the (osk.exe) App. I then (programmatically) copied the App to various folders and run it from there but again the same problem. It appears that an app from System32 and SysWOW64 (on my Win7) can't be executed programmatically unless a security/privilege setting is adjusted however my colleague can execute the App on his Win8. As soon as I get a chance I’ll try the same on another Win7 and see how I go.

Thanks for all your suggestions.
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 40346332
Sorry, I have been wrong with my troubleshooting steps, it indeed works when following http:#a40344018.
The accepted comment is still correct. On a 64bit system, call SysNative\OSK.exe, on a 32bit system System32\OSK.exe. It doesn't matter whether the starting process is 64bit or 32bit, and you only have issues with 32bit app on 64bit OS.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question