Solved

How to run osk.exe in Windows\System32 folder

Posted on 2014-09-24
7
2,280 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 68

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 68

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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 68

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 68

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

Why do Marketing keep bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

Join & Write a Comment

This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
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 …
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

757 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

18 Experts available now in Live!

Get 1:1 Help Now