Solved

How to run osk.exe in Windows\System32 folder

Posted on 2014-09-24
7
2,489 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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...
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

813 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now