• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Execute exe (email client) from javascript

New Here ,
Apr 12, 2013 Apr 12, 2013

Copy link to clipboard

Copied

I am trying to convert my VBScript that export and attach a jpeg to Thunderbird email client in Javascript, but I am stuck on the execute of thunderbird exe.

This is what I am doing in VBScript and it works very well:

Set s = CreateObject("WScript.Shell")

s.run chr(34) & "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe"& chr(34) & " -compose " & "attachment=" & myFileName

The only function I've found in Javascript is .execute(); but I have no idea how to pass the parameter "-compose attachment=myFileName"

var myFile = new File("C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe");

myFile.execute();

Any attempt to add with escaped doubled quote \" in the parameters or create a string with it does not works, looks like .execute(); only can start the main program

I did also a dos syntax for the filename without spaces but it can start only Thunderbird and don't accept -compose param (C:\\PROGRA~2\\MOZILL~3\\THUNDE~1.EXE)

Any idea how can I start this in javascript?

"C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe" -compose " & "attachment=" & myFileName

Thanks for your help.

TOPICS
Scripting

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 12, 2013 Apr 12, 2013

Copy link to clipboard

Copied

LATEST

Hi,

run your VB via doScript in ExtendScript

http://jongware.mit.edu/idcs5/pc_Application.html#doScript

addition:

use ScriptLanguage.VISUAL_BASIC which is supported although not in the documentation ...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines