Tuesday, May 4, 2010

Start an iconified application on Windows using batch

Suppose that you want to start an application on Windows using a batch which shows its icon on desktop.
Follow the example.

1. Create the batch file that contains the command to start the application.
In this example, I've created the batch file 1___timer_scheduled.bat.

2. Create a link to this command (use the pop-up menu) referencing the application's icon using the Change Icon button (red arrow).



3. Create another batch file referencing the link created before, using this command:

start "Timer6030" /D"D:\miniTools\timer\" "D:\miniTools\timer\1___timer_scheduled.lnk"

Of course, this example uses my environment paths. Switch to yours.

Note: The trick is not using the "/B"  option of the start command.

This batch creates a new window which uses the link's configuration and not the system's default configuration.

It's done.
Use the last batch created (step 3) to start the application.
The link created on step 2 works for a manual starting from the desktop, but it fails on Task Scheduler.
Check the figures below.


Using the link created on step 2 - the icon fails (red arrows): 

   



 Using the link created on step 3 - desired icon is shown:
   

No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...