Classic Shell/Explorer Custom Command

Page 2 of 2 FirstFirst 12

  1. Ivo
    Posts : 398
    Windows 7 Home 64, Vista Ultimate 64
       #11

    I finally had some time to investigate, and I found the problem. The thing is VBS files are not executables but documents.
    You need to use the command "WScript.exe E:\MKLink.vbs"

    If the command is just "MKLink.vbs", then I execute it using the ShellExecute API, which understands how to launch documents like VBS files, or TXT files, etc. However it is a fire and forget type API.

    For more complex commands that use %3, %4 or %5, I need to have a direct access to the process that runs, so I can wait for it to finish. For that I need to use the API CreateProcess, which is not smart enough to know that for VBS files it needs to run WScript.exe.
      My Computer


  2. BXF
    Posts : 8
    Windows 7 Pro 64bit
    Thread Starter
       #12

    WScript.exe "E:\zzz.vbs" "%3" "E:\FPVTemp" works!

    Thanks for the effort, and the for program, of course.

    By the way, just FYI, your HELP says "Keep in mind that if the current folder is a root of a drive it will end with a backslash (like C:\)". I get a double-quote rather than a backslash: i.e. C:"

    All the best.
      My Computer


  3. Ivo
    Posts : 398
    Windows 7 Home 64, Vista Ultimate 64
       #13

    Most likely "%1" turns into "C:\", and \" is considered an escaped double quote by the command line parser. I don't think there's much I can do about it, as I have no control over the parser of WScript or whatever tool you are using.
      My Computer


  4. BXF
    Posts : 8
    Windows 7 Pro 64bit
    Thread Starter
       #14

    It's not a problem. If I get a 3-character "path to current folder" in the form of X:?, I just drop the third character.

    Thanks again.
      My Computer


 
Page 2 of 2 FirstFirst 12

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:15.
Find Us