11 Replies Latest reply on Mar 26, 2018 8:40 AM by r-bin

    app.system: hide command line window?

    Sergey Kritskiy Level 1

      Hi everyone,

       

      I'm running a app.system() command and on OSX it runs silently, but on Windows it shows a command line window for a moment:

      launch.gif

       

      I tried:

      - app.system('"C:\Program Files\Adobe\Adobe Photoshop CC 2017\Photoshop.exe" "D:\test.jsx"')

      - new File('/D/test.bat').execute();

       

      In both cases command line window appears...

       

      Does anyone know how can I hide it?

       

      Thanks,

      Sergey

        • 1. Re: app.system: hide command line window?
          SuperMerlin Level 5

          app.system(); commands or executing a bat file will always open a dos window.

           

          You could add a function to the BasicExternalObject external lib example in the Bridge SDK

          Using CreateProcess(); with SW_HIDE

           

          I have tried but failed to get it working so it needs someone with c++ knowledge.

           

          https://console.adobe.io/downloads/br for the sdk.

          • 2. Re: app.system: hide command line window?
            r-bin Level 5

            You can try this method

             

            run_cmd(false, "C:\\A3\\a.bat")
            
            ////////////////////////////////////////////////////////////////////////////////////
            function run_cmd(visible)
                {
                try {
                    if (arguments[1] == undefined) return false;
            
                    var tmp_name = "tmp.js";
            
                    var file = new File(Folder.temp.fsName + "\\" + tmp_name);
                    file.open("w")
                    file.encoding = "UNICODE-1-1-UTF-8";
            
                    if (file_error(file)) return false;
            
                    var s = "\"\\\"\"+" + arguments[1].toSource() + "+\"\\\"\"";    
                    var n = 2;
                    while (arguments[n] != undefined) s += ("+\" \"+\"\\\"\"+" + arguments[n++].toSource() + "+\"\\\"\"");    
            
                    file.writeln("WScript.CreateObject(\"WScript.Shell\").Run(" + s + "," + (visible?"1":"0") + ",true);");
                    file.writeln("with(new ActiveXObject(\"Scripting.FileSystemObject\")) GetFile(GetSpecialFolder(2).Path+\"\\\\\"+\"" + tmp_name + "\").Delete();");  
            
                    if (file_error(file)) { file.close(); return false; }
            
                    file.close();
                    file.execute();
            
                    var ok = false;
                    try {
                        while (1)
                            {
                            if (!file.exists) { ok = true; break; }
            
                            step_by_step();
                            }   
                        }
                    catch(e) { }
            
                    accelerated();            
            
                    return ok;
                    }
                catch(e) { throw(e); }
                }
            
            ////////////////////////////////////////////////////////////////////////////////////
            function accelerated()  { set_performance("accelerated"); }
            function step_by_step() { set_performance("stepByStep");  }
            
            function set_performance(mode)
                {
                try {
                    var d1 = new ActionDescriptor();
                    var d2 = new ActionDescriptor();
                    var r1 = new ActionReference();
            
                    r1.putProperty( charIDToTypeID( "Prpr" ), charIDToTypeID( "PbkO" ) );
                    r1.putEnumerated( charIDToTypeID( "capp" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
            
                    d1.putReference( charIDToTypeID( "null" ), r1 );
            
                    d2.putEnumerated( stringIDToTypeID( "performance" ), stringIDToTypeID( "performance" ), stringIDToTypeID( mode ) );
            
                    d1.putObject( charIDToTypeID( "T   " ), charIDToTypeID( "PbkO" ), d2 );
                    executeAction( charIDToTypeID( "setd" ), d1, DialogModes.NO );
                    }
                catch (e) { throw(e); }
                }
            
            • 3. Re: app.system: hide command line window?
              Sergey Kritskiy Level 1

              r-bin, I've seen a similar method for a .vbs-file but since File.execute() works as a double click for me this code opens Sublime Text with the js-file... :/

              • 4. Re: app.system: hide command line window?
                r-bin Level 5

                Run Photoshop as administrator.
                Run the script (once)

                 

                app.system('assoc .js=JSFile')
                app.system('ftype JSFile=C:\\Windows\\System32\\WScript.exe "%1" %*')
                
                • 5. Re: app.system: hide command line window?
                  Kukurykus Adobe Community Professional

                  Run it from Photoshop:

                   

                  if (!(vbs = File((fN = $.fileName).slice(0, -3) + 'vbs')).exists) {
                       txt = 'CreateObject("Shell.Application").ShellExecute """'
                       txt += Folder.startup.fsName + '\\Photoshop.exe""", "'
                       txt += File(fN).fsName + '"', vbs.open('w')
                       vbs.write(txt), vbs.close(), vbs.execute()
                  }
                  
                  else alert('Silent Mode'), vbs.remove()
                  

                   

                  If you run it from ExtendScript ToolKit with targeted Photoshop it will work only once. Second time it crash Photoshop. I forgot how I did that it worked smoothly both in ESTK and Photoshop. Anyway in Photoshop only it works flawlessly

                   

                  I found it. You must remove alert(). If you want to run it with ESKT with alert() I think there is need of little delay in vbs.

                  • 6. Re: app.system: hide command line window?
                    SuperMerlin Level 5

                    Have you tried....

                    #target photoshop;

                    $.evalFile(File("/d/test.jsx"));

                    • 7. Re: app.system: hide command line window?
                      Sergey Kritskiy Level 1

                      r-bin, thanks, however I'd prefer not to run PS as a administrator for this.. :/

                       

                      Kukurykus, thanks. I wonder however if it's going to be the same problem as with r-bin's approach: for File.execute() to work properly, this file should have a correct "open with" software. My knowledge of Windows is limited, is it possible that someone can have .vbs file to be executed by a different file rather than "MS Windows Based Script Host"?

                       

                      SuperMerlin, thanks: this will work for a script file but my initial goal was to run a system command. Sorry if my example with PS running a jsx file was confusing

                      • 8. Re: app.system: hide command line window?
                        Kukurykus Adobe Community Professional

                        This if you want to run script from ESTK as well multiply times. As you see now there is 1500ms delay, so quite much. I tried the same with ESTK where I didn't run the same script, but separate one, and still found there's need of some delay, when I ran script from ESTK with targeted Photoshop. So I guess there is some bug in ESKT - as with Photoshop only it wroks well.

                         

                        if (!(vbs = File((fN = $.fileName).slice(0, -3) + 'vbs')).exists) {
                             txt = 'WScript.Sleep 1500\rCreateObject("Shell.Application").ShellExecute """'
                             txt += Folder.startup.fsName + '\\Photoshop.exe""", "' + File(fN).fsName + '"'
                             vbs.open('w'), vbs.write(txt), vbs.close(), vbs.execute()
                        }
                        
                        else alert('Silent Mode'), vbs.remove()
                        

                         

                        You wanted script that you can run without Command Prompt side effect on Windows and you got, so I don't understand what do you want else, anyway:

                         

                        I wonder however if it's going to be the same problem as with r-bin's approach: for File.execute() to work properly, this file should have a correct "open with" software.

                         

                        I'm sorry I don't understand it. Could you explain it in details. I didn't try yet r-bin, but my script works with no problem. Could you also say what do you mean by: a correct "open with" software?

                         

                        My knowledge of Windows is limited, is it possible that someone can have .vbs file to be executed by a different file rather than "MS Windows Based Script Host"?

                         

                        Give me some example what do you mean again. What I see .vbs is Windows built-in language, isn't it? .vbs file to be executed by other file(...), can you say more about it, and what problem current version of script does or might does?

                        • 9. Re: app.system: hide command line window?
                          Sergey Kritskiy Level 1

                          File.execute() is the same as double-clicking a file in Windows. By default .vbs files are associated with Windows Based Script Host app which simply executes them — so everything works. But if I change "Opens with" to something different, say, to text editor, File.execute() will open a .vbs file in that editor, that's exactly what happened when I used r-bin's example: he was doing File.execute() on a .js file and on my machine js-files are opened by a text editor.

                          So my question was how reliable is .execute() method for .vbs files, is it common for people to change those or I shouldn't worry about this.

                          • 10. Re: app.system: hide command line window?
                            Kukurykus Adobe Community Professional

                            Okey, I think now I understand. This is of course unusual situation, because .vbs files set to be opened by for ex. notepad can't be executed anymore as far as other special program won't enforce it.

                             

                            I experienced alike situation in past when I set somehow all. my .jsx files were executed as .js. I don't remember well, but problem was they never were opened in Photoshop (ran from Windows) but directly in ESTK. That I did was to change in properties application they were opened with to Photoshop. But then they were opened only in Photoshop, but never in ESTK. I was not familiar in that time with Windows Registry, but fortunately found I can change by registry .jsx settings to default, that it worked finally as .jsx, not .js anymore. Later I learned how to change it by script as well, so without manual opening registry to manipulate its data (however much time elaplsed I did that last time).

                             

                            Certianly the script you got may be enriched by .bat that will recover original behaviour of .vbs files while opening. So they will be opened normally, not as .txt. Problem is, if that will be changed then user will be later surprised why his .vbs are not opened in text editor but executed like originally used. It can be done of course the way that .bat script checks "open with" options in registry. Takes it to memory, then change it to default .vbs, and after ran it, it change 'open with' options back to Notepad. That is not best solution and even if that was applied then I am affraid there is another problem. To use these changes in regisrty User's Computer restart might be needed to activate it.

                             

                             

                            Well for now I won't focus on it, but experienced r-bin should find solution for it

                            • 11. Re: app.system: hide command line window?
                              r-bin Level 5

                              Well, if you do not want to restore standard file associations then try this way.

                               

                              By the way in the last script there was an error, file_error() function is not defined

                               

                              run_cmd(false, "C:\\A3\\a.bat")  
                                
                              ////////////////////////////////////////////////////////////////////////////////////  
                              function run_cmd(visible)  
                                  {  
                                  try {  
                                      if (arguments[1] == undefined) return false;  
                                
                                      var tmp_name = "tmp.js";  
                                
                                      var file = new File(Folder.temp.fsName + "\\" + tmp_name);  
                                      file.open("w")  
                                      file.encoding = "UNICODE-1-1-UTF-8";  
                                
                                      if (file.error) return false;  
                                
                                      var s = "\"\\\"\"+" + arguments[1].toSource() + "+\"\\\"\"";      
                                      var n = 2;  
                                      while (arguments[n] != undefined) s += ("+\" \"+\"\\\"\"+" + arguments[n++].toSource() + "+\"\\\"\"");      
                                
                                      file.writeln("WScript.CreateObject(\"WScript.Shell\").Run(" + s + "," + (visible?"1":"0") + ",true);");  
                                      file.writeln("with(new ActiveXObject(\"Scripting.FileSystemObject\")) GetFile(GetSpecialFolder(2).Path+\"\\\\\"+\"" + tmp_name + "\").Delete();");    
                                
                                      if (file.error) { file.close(); return false; }  
                                
                                      file.close();  
                              
                                      if (run_tmp_lnk()) return false;
                                
                                      var ok = false;  
                                      try {  
                                          while (1)  
                                              {  
                                              if (!file.exists) { ok = true; break; }  
                                
                                              step_by_step();  
                                              }     
                                          }  
                                      catch(e) { }  
                                
                                      accelerated();              
                                
                                      return ok;  
                                      }  
                                  catch(e) { alert(e); }  
                                  }  
                                
                              ////////////////////////////////////////////////////////////////////////////////////  
                              function accelerated()  { set_performance("accelerated"); }  
                              function step_by_step() { set_performance("stepByStep");  }  
                                
                              function set_performance(mode)  
                                  {  
                                  try {  
                                      var d1 = new ActionDescriptor();  
                                      var d2 = new ActionDescriptor();  
                                      var r1 = new ActionReference();  
                                
                                      r1.putProperty( charIDToTypeID( "Prpr" ), charIDToTypeID( "PbkO" ) );  
                                      r1.putEnumerated( charIDToTypeID( "capp" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );  
                                
                                      d1.putReference( charIDToTypeID( "null" ), r1 );  
                                
                                      d2.putEnumerated( stringIDToTypeID( "performance" ), stringIDToTypeID( "performance" ), stringIDToTypeID( mode ) );  
                                
                                      d1.putObject( charIDToTypeID( "T   " ), charIDToTypeID( "PbkO" ), d2 );  
                                      executeAction( charIDToTypeID( "setd" ), d1, DialogModes.NO );  
                                      }  
                                  catch (e) { throw(e); }  
                                  }  
                              
                              ////////////////////////////////////////////////////////////////////////////////////  
                              
                              //Creates and runs file: %TEMP%\tmp.lnk, with command line: C:\Windows\System32\wscript.exe %TEMP%\tmp.js
                              
                              function run_tmp_lnk() 
                                  {
                                  try {
                                      var data = String.fromCharCode(
                                      0x4C,0x00,0x00,0x00,0x01,0x14,0x02,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46,
                                      0xA3,0x00,0x08,0x00,0x20,0x00,0x00,0x00,0x42,0xDE,0xA6,0xA2,0x13,0x04,0xCA,0x01,0x42,0xDE,0xA6,0xA2,
                                      0x13,0x04,0xCA,0x01,0x70,0x5B,0xFA,0x7B,0x20,0x04,0xCA,0x01,0x00,0x2A,0x02,0x00,0x00,0x00,0x00,0x00,
                                      0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x01,0x14,0x00,
                                      0x1F,0x50,0xE0,0x4F,0xD0,0x20,0xEA,0x3A,0x69,0x10,0xA2,0xD8,0x08,0x00,0x2B,0x30,0x30,0x9D,0x19,0x00,
                                      0x2F,0x43,0x3A,0x5C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                                      0x00,0x00,0x00,0x52,0x00,0x31,0x00,0x00,0x00,0x00,0x00,0x34,0x4A,0x36,0x7F,0x10,0x00,0x57,0x69,0x6E,
                                      0x64,0x6F,0x77,0x73,0x00,0x3C,0x00,0x08,0x00,0x04,0x00,0xEF,0xBE,0xEE,0x3A,0xA3,0x14,0x34,0x4A,0x36,
                                      0x7F,0x2A,0x00,0x00,0x00,0x48,0x02,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                                      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x57,0x00,0x69,0x00,0x6E,0x00,0x64,0x00,0x6F,0x00,0x77,0x00,0x73,
                                      0x00,0x00,0x00,0x16,0x00,0x56,0x00,0x31,0x00,0x00,0x00,0x00,0x00,0x7A,0x4C,0x77,0x3D,0x10,0x00,0x53,
                                      0x79,0x73,0x74,0x65,0x6D,0x33,0x32,0x00,0x00,0x3E,0x00,0x08,0x00,0x04,0x00,0xEF,0xBE,0xEE,0x3A,0xA4,
                                      0x14,0x7A,0x4C,0x77,0x3D,0x2A,0x00,0x00,0x00,0x52,0x08,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
                                      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x53,0x00,0x79,0x00,0x73,0x00,0x74,0x00,0x65,
                                      0x00,0x6D,0x00,0x33,0x00,0x32,0x00,0x00,0x00,0x18,0x00,0x5E,0x00,0x32,0x00,0x00,0x2A,0x02,0x00,0xEE,
                                      0x3A,0xD9,0x09,0x20,0x00,0x77,0x73,0x63,0x72,0x69,0x70,0x74,0x2E,0x65,0x78,0x65,0x00,0x44,0x00,0x08,
                                      0x00,0x04,0x00,0xEF,0xBE,0xED,0x3A,0x5A,0xBD,0xED,0x3A,0x5A,0xBD,0x2A,0x00,0x00,0x00,0x14,0x62,0x00,
                                      0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,
                                      0x00,0x73,0x00,0x63,0x00,0x72,0x00,0x69,0x00,0x70,0x00,0x74,0x00,0x2E,0x00,0x65,0x00,0x78,0x00,0x65,
                                      0x00,0x00,0x00,0x1A,0x00,0x00,0x00,0x4E,0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1C,
                                      0x00,0x00,0x00,0x2D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4D,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x03,
                                      0x00,0x00,0x00,0x50,0x6C,0x78,0xEC,0x10,0x00,0x00,0x00,0x00,0x43,0x3A,0x5C,0x57,0x69,0x6E,0x64,0x6F,
                                      0x77,0x73,0x5C,0x53,0x79,0x73,0x74,0x65,0x6D,0x33,0x32,0x5C,0x77,0x73,0x63,0x72,0x69,0x70,0x74,0x2E,
                                      0x65,0x78,0x65,0x00,0x00,0x0D,0x00,0x25,0x00,0x54,0x00,0x45,0x00,0x4D,0x00,0x50,0x00,0x25,0x00,0x5C,
                                      0x00,0x74,0x00,0x6D,0x00,0x70,0x00,0x2E,0x00,0x6A,0x00,0x73,0x00,0x10,0x00,0x00,0x00,0x05,0x00,0x00,
                                      0xA0,0x25,0x00,0x00,0x00,0xD5,0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0x0B,0x00,0x00,0xA0,0x77,0x4E,0xC1,
                                      0x1A,0xE7,0x02,0x5D,0x4E,0xB7,0x44,0x2E,0xB1,0xAE,0x51,0x98,0xB7,0xD5,0x00,0x00,0x00,0x08,0x02,0x00,
                                      0x00,0x09,0x00,0x00,0xA0,0xAD,0x00,0x00,0x00,0x31,0x53,0x50,0x53,0x30,0xF1,0x25,0xB7,0xEF,0x47,0x1A,
                                      0x10,0xA5,0xF1,0x02,0x60,0x8C,0x9E,0xEB,0xAC,0x29,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x00,0x1F,0x00,
                                      0x00,0x00,0x0C,0x00,0x00,0x00,0x77,0x00,0x73,0x00,0x63,0x00,0x72,0x00,0x69,0x00,0x70,0x00,0x74,0x00,
                                      0x2E,0x00,0x65,0x00,0x78,0x00,0x65,0x00,0x00,0x00,0x29,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x1F,
                                      0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x1F,0x04,0x40,0x04,0x38,0x04,0x3B,0x04,0x3E,0x04,0x36,0x04,0x35,
                                      0x04,0x3D,0x04,0x38,0x04,0x35,0x04,0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x00,
                                      0x40,0x00,0x00,0x00,0x00,0x66,0x0E,0xA3,0x13,0x04,0xCA,0x01,0x15,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,
                                      0x00,0x15,0x00,0x00,0x00,0x00,0x2A,0x02,0x00,0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0x0E,0x00,0x00,
                                      0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x61,0x0A,0x7C,0x20,0x04,0xCA,0x01,0x00,0x00,0x00,0x00,0x89,0x00,
                                      0x00,0x00,0x31,0x53,0x50,0x53,0xE2,0x8A,0x58,0x46,0xBC,0x4C,0x38,0x43,0xBB,0xFC,0x13,0x93,0x98,0x6D,
                                      0xCE,0x6D,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x2D,0x00,0x00,0x00,0x53,0x00,
                                      0x2D,0x00,0x31,0x00,0x2D,0x00,0x35,0x00,0x2D,0x00,0x32,0x00,0x31,0x00,0x2D,0x00,0x31,0x00,0x37,0x00,
                                      0x32,0x00,0x37,0x00,0x30,0x00,0x39,0x00,0x30,0x00,0x31,0x00,0x35,0x00,0x30,0x00,0x2D,0x00,0x32,0x00,
                                      0x39,0x00,0x33,0x00,0x39,0x00,0x35,0x00,0x34,0x00,0x33,0x00,0x37,0x00,0x2D,0x00,0x33,0x00,0x30,0x00,
                                      0x34,0x00,0x32,0x00,0x37,0x00,0x33,0x00,0x34,0x00,0x39,0x00,0x31,0x00,0x34,0x00,0x2D,0x00,0x31,0x00,
                                      0x30,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x59,0x00,0x00,0x00,0x31,0x53,
                                      0x50,0x53,0xED,0x30,0xBD,0xDA,0x43,0x00,0x89,0x47,0xA7,0xF8,0xD0,0x13,0xA4,0x73,0x66,0x22,0x3D,0x00,
                                      0x00,0x00,0x64,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x53,0x00,0x79,0x00,0x73,
                                      0x00,0x74,0x00,0x65,0x00,0x6D,0x00,0x33,0x00,0x32,0x00,0x20,0x00,0x28,0x00,0x43,0x00,0x3A,0x00,0x5C,
                                      0x00,0x57,0x00,0x69,0x00,0x6E,0x00,0x64,0x00,0x6F,0x00,0x77,0x00,0x73,0x00,0x29,0x00,0x00,0x00,0x00,
                                      0x00,0x00,0x00,0x6D,0x00,0x00,0x00,0x31,0x53,0x50,0x53,0xA6,0x6A,0x63,0x28,0x3D,0x95,0xD2,0x11,0xB5,
                                      0xD6,0x00,0xC0,0x4F,0xD9,0x18,0xD0,0x51,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,
                                      0x20,0x00,0x00,0x00,0x43,0x00,0x3A,0x00,0x5C,0x00,0x57,0x00,0x69,0x00,0x6E,0x00,0x64,0x00,0x6F,0x00,
                                      0x77,0x00,0x73,0x00,0x5C,0x00,0x53,0x00,0x79,0x00,0x73,0x00,0x74,0x00,0x65,0x00,0x6D,0x00,0x33,0x00,
                                      0x32,0x00,0x5C,0x00,0x77,0x00,0x73,0x00,0x63,0x00,0x72,0x00,0x69,0x00,0x70,0x00,0x74,0x00,0x2E,0x00,
                                      0x65,0x00,0x78,0x00,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,
                                      0x03,0x00,0x00,0xA0,0x58,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x6F,0x6D,0x70,0x75,0x74,0x65,0x72,
                                      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0xF5,0xD6,0x56,0x79,0xE1,0x9A,0x44,0x8F,0x48,0xC4,0x54,
                                      0x8D,0x9D,0xB9,0x99,0x28,0xD9,0x33,0xA5,0x49,0x80,0xDE,0x11,0xA8,0xA5,0x00,0x15,0xAF,0x01,0x7B,0xD5,
                                      0x34,0xF5,0xD6,0x56,0x79,0xE1,0x9A,0x44,0x8F,0x48,0xC4,0x54,0x8D,0x9D,0xB9,0x99,0x28,0xD9,0x33,0xA5,
                                      0x49,0x80,0xDE,0x11,0xA8,0xA5,0x00,0x15,0xAF,0x01,0x7B,0xD5,0x00,0x00,0x00,0x00);
                                      
                                      var file = new File(Folder.temp.fsName + "\\" + "tmp.lnk");  
                                      if (file.exists) file.remove();
                              
                                      if (file.error) return file.error;
                              
                                      file.open("w")  
                                      file.encoding = "BINARY";
                              
                                      if (file.error) return file.error;
                              
                                      file.write(data);
                              
                                      if (file.error) return file.error;
                              
                                      file.close();
                                      file.execute();
                              
                                      file.remove();
                              
                                      return "";
                                      }
                                  catch (e) { alert(e) }
                                  }