Solved

How to run osk.exe in Windows\System32 folder

Posted on 2014-09-24
7
2,599 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

792 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