Windows File Explorer Button
How can I add a button to start windows file explorer and open a certain path.
For example the desktop.
Regards,
Abdelrazzaq Hiasat
Answers
You can add Windows Application aspect to your system, and configure this aspect according to your certain path.
On Graphic Builder side add a verb button and as a verb reference please select your windows application aspect.
For more details, please see attach photo.
Hope it helps you.
Hi
Following example might help you to achieve the desired function.
1) Create a new aspect of type: Scripting Aspect. For convenience give the new aspect an appropriate name, e.g. "Windows Explorer".
2) Example code, see "Scripting Aspect - function WindowsExplorer() - Code tab, code.txt", "Scripting Aspect - function WindowsExplorer() - Code tab.jpg" and "Scripting Aspect - function WindowsExplorer() - Presentation tab, ensure 'Object Verb' checked.jpg"
The example code starts C:\Windows\explorer.exe at the following location: \\SASSNA050\Backup
Ensure that "Object Verb" is checked in the Presentation tab.
3) On a Graphic Display PG2, add a "Verb Button" and set VerbReference = WindowsExplorer [which corresponds to the function WindowsExplorer() within the new Scripting Aspect (with name e.g. "Windows Explorer")]
function WindowsExplorer()
{
try
{
var helper = new ActiveXObject("ABB.AfwFocusManager.1");
var shell = helper.CreateObjectForScripting("WScript.Shell");
shell.Run("C:\\WINDOWS\\explorer.exe \\\\SASSNA050\\Backup");
}
catch(e) { alert("NAS is not available at the moment"); }
}
Best regards
Carsten
Add new comment