Jump to content
tsjippy

DLL cannot be loaded

Recommended Posts

tsjippy

Hi there,

in my autoit script I run the following command:

$result = run('"' & $SystemDrive & 'Windows\System32\netsh.exe" wlan export profile key=clear folder="' & $installationpath & '\InstallationFiles\Network"', $SystemDrive & 'Windows\System32', @SW_HIDE, $stderr_child + $stdout_child)

This works great under windows 7 and 8, but on Windows 10 I get this error:

The following helper DLL cannot be loaded: WLANCFG.DLL.
The following command was not found: wlan export profile key=clear folder=F:WindowsInstallerProInstallationFilesNetwork.

However, if I run the command in on the same machine in a command prompt it works fine.

Any Ideas? Running with @comspec did not help.

Share this post


Link to post
Share on other sites
JohnOne

Try...

$result = run('"' & @SystemDir & '\netsh.exe" wlan export profile key=clear folder="' & $installationpath & '\InstallationFiles\Network"', $SystemDrive & 'Windows\System32', @SW_HIDE, $stderr_child + $stdout_child)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
tsjippy

FOund the answer:

If @OSArch = "X64" Then DllCall('kernel32.dll', 'int', 'Wow64EnableWow64FsRedirection', 'int', 0)
    $result = run('"' & $SystemDrive & 'Windows\System32\netsh.exe" wlan export profile key=clear folder="' & $installationpath & '\InstallationFiles\Network"', $SystemDrive & 'Windows\System32', @SW_HIDE, $stderr_child + $stdout_child)
    ProcessWaitClose($result, 2)
    If @OSArch = "X64" Then DllCall('kernel32.dll', 'int', 'Wow64EnableWow64FsRedirection', 'int', 1)

Share this post


Link to post
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

×