Hi mikeyww - Many thanks for your reply.
I tried this:
Code: Select all
#SingleInstance Force
; Prompt to 'Run as Admin', i.e. show UAC dialog
If Not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
ExitApp
}
Clipboard := "" ; Clear the clipboard of any content
FileSelectFile, SelectedFile, 3, , Select an install file, (install.wim; install.esd)
if (SelectedFile = "")
{
MsgBox, The user didn't select anything.
ExitApp
}
;else
;MsgBox dism /get-wiminfo /wimfile:%SelectedFile% /index:1 ;Use MsgBox to test output to commandline
RunWait, %comspec% /c dism /get-wiminfo /wimfile:%SelectedFile% /index:1, , hide | clip ;Pass the parameters to DISM
MsgBox, %Clipboard% ; Display the result
Still doesn't work.
I'm using comspec because DISM is for commandline use only and I want to both hide the console output window and redirect the result. I've also tried using
> instead of
| as the redirector but I still can't get the output to the clipboard. It's not a clipboard issue because if I add a ClipWait line then the script just waits forever and if I remove the redirection it still doesn't work.
As a test I changed the comspec line to:
Code: Select all
RunWait, %comspec% dism /get-wiminfo /wimfile:%SelectedFile% /index:1, ;Pass the parameters to DISM
This showed me the commandline console window but DISM didn't fire within it.
I've also tried using the full path to the DISM executable with no parameters but still no success:
Code: Select all
RunWait, %comspec% C:\Windows\System32\dism.exe ;Run DISM
The issue is quite clearly DISM not firing... which I don't understand.
(I'm sorry but I didn't understand what you meant by making "clip" 'with the command line instead of making it look like an AHK option'.)