Hello,
The following code selects arg1 in a Windows Explorer folder:
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("""" & WScript.Arguments(0) & """")
WScript.Sleep 400
' objShell.SendKeys("^a{F5}") ' Deslect All.
Set objShellAPP = CreateObject("Shell.Application")
On Error Resume Next ' For new unsaved files.
With objShellAPP.Windows(objShellAPP.Windows.Count - 1).document
.SelectItem .Folder.Items.Item(WScript.Arguments(1)), 17
End With
Set objShell = Nothing
Set objShellAPP = Nothing
If fileA is already selected in the folder and fileB is passed as arg1, both files are selected.
How can I have fileA deselected and only fileB selected?
The commented line
objShell.SendKeys("^a{F5}")
is a workaround, but there must be a better way.
Thank you.