6 messages in com.googlegroups.google-desktop-developerRe: Grabbing environment variables fr...
FromSent OnAttachments
Nick Spacek20 Feb 2006 07:44 
tecjda20 Feb 2006 08:02 
Nick Spacek20 Feb 2006 08:36 
Nick Spacek20 Feb 2006 10:15 
tecjda20 Feb 2006 10:22 
Nick Spacek20 Feb 2006 10:57 
Subject:Re: Grabbing environment variables from javascript
From:tecjda (pion@gmail.com)
Date:02/20/2006 10:22:09 AM
List:com.googlegroups.google-desktop-developer

Nick,

You can only run a file that doesn't have a space in the name or path.

Use this function...

function openFile(sFilename, bCopyFirst) { bCopyFirst = (bCopyFirst == null ? false : bCopyFirst);

var objWSH = new ActiveXObject("WScript.Shell"); var objFSO = new ActiveXObject("Scripting.FileSystemObject");

if (!objFSO.FileExists(sFilename)) { alert("Cannot find file to open.\n\n" + sFilename); return; }

if (sFilename.indexOf(" ") != -1 || bCopyFirst) { objFSO.CopyFile(sFilename, "c:\\temp\\", true); sFilename = "c:\\temp\\" + sFilename.substring(sFilename.lastIndexOf("\\") + 1); }

objWSH.run(sFilename); }

JD