cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jim_hobday
Level 2

Cant make Shortcut Run Minimised (Win)

Newbie - so please excuse me if my searching skills did not reveal an existing answer...

At the moment IA successfully creates a Windows Desktop Shortcut to a batch file that in turn launches a Java Desktop App. The stdout and stderr are useful in the DOS window so I don't want to run javaw.exe but I would like to minimise the DOS window.

Now MS-Windows shortcuts allow you to specify "Run Minimised" but the IA "Create Alias, Link, Shortcut" doesn't have that option.

Am I missing something? or if I'm right, has anyone found a way around it?

Cheers
Jim
Labels (1)
0 Kudos
(1) Reply
jim_hobday
Level 2

As a work around (because I have custom code running anyway) I have opted to

[LIST=1]
  • detect Windows
  • create a vb script file
  • create the contents (according to the users install choices - e.g. location) like this..


    set WshShell = WScript.CreateObject("WScript.Shell")
    strDesktop = WshShell.SpecialFolders("Desktop")
    set oMyShortcut = WshShell.CreateShortcut(strDesktop & "\Sentences 4.0.39.PE.lnk")
    oMyShortcut.WindowStyle = 7
    oMyShortcut.IconLocation = "C:\Program Files\Lazy\SentencesPersonal40\sentences.ico"
    oMyShortcut.Description = "Start Sentences Personal Edition"
    OMyShortcut.TargetPath = "C:\Program Files\Lazy\SentencesPersonal40\sentences.bat"
    OMyShortcut.WorkingDirectory = "C:\Program Files\Lazy\SentencesPersonal40\sentences.bat"
    oMyShortCut.Save


    And then execute it
    Process p = Runtime.getRuntime().exec("cscript //T:1 short.vbs", null, dir);

    using the cscript exe that is standard on XP, Vista and Windows 7.

    Simple. Well simpler than calling the Windows API from Java.

    Anyone know a workaround for Linux?

    I'm presuming MacOSX doesn't show you the console anyway - can't test at the moment.
  • 0 Kudos