Trying to execute .SCF file from nnCron using hotkey

nnCron and nnCron LITE discussion

Trying to execute .SCF file from nnCron using hotkey

Postby LuckMan212 » Tue, 04 Apr 2006, 17:03

hello. I don't show "quick launch" toolbar on my desktop-- it takes too much space. So I sometimes want to Show Desktop (hides all open windows) so I made hotkey in nnCron to do this:
Code: Select all
#( CLASSIC-TASK-#-HK_show_desktop
WatchHotKey: "^+9"
AsLoggedUser
NoLog
Action:
<VBScript>
   set Shell = WScript.CreateObject("Shell.Application")
   Shell.Open "%FOLDER-APP-DATA%\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf"
</SCRIPT>
)#
This works but sometimes it is very slow to respond (2-3 seconds). I would like to make a better method that calls this ".scf" file directly without the use of VBScript.

I tried smth like:

Code: Select all
S" cmd.exe /c start %FOLDER-APP-DATA%\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf" StartApp DROP
but it gives errors.

can you suggest a way that I might achieve this?
thanks :D
nncron.exe v 1.91 Build 1083 21.03.2006
LuckMan212
 
Posts: 133
Joined: Mon, 04 Jul 2005, 11:19

Postby Valery_Kondakoff » Tue, 04 Apr 2006, 17:40

There is an example in the docs - how to run applications using *.lnk files: http://www.nncron.ru/help/EN/add_info/t ... ks.htm#lnk . You can use it to run *.scf files.

Code: Select all
#( test_scf
NoActive
CREATE path_var 256 ALLOT
Action:
FOLDER-APP-DATA path_var PLACE
S" \Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf" path_var +PLACE
5 0 0 path_var COUNT S>ZALLOC Z" open" 0 ShellExecuteA DROP
)#
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby LuckMan212 » Tue, 04 Apr 2006, 17:53

works! :D :D
brilliant thank you
LuckMan212
 
Posts: 133
Joined: Mon, 04 Jul 2005, 11:19

Postby Valery_Kondakoff » Tue, 04 Apr 2006, 18:02

you can make this example shorter and easier to understand just by using the exact path. like this:

Code: Select all
#( test_scf
NoActive
Action:
5 0 0 Z" C:\Documents and Settings\kondakov\Application Data\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf" Z" open" 0 ShellExecuteA DROP
)#
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby LuckMan212 » Wed, 05 Apr 2006, 06:56

thanks Valery!
is there anyway to substitute
C:\Documents and Settings\kondakov\Application Data\

with
%FOLDER-APP-DATA%

I dont know how to insert this using Postfix notation.

somthing about EVAL-SUBST maybe?
I tried:
5 0 0 Z" %FOLDER-APP-DATA%\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf" EVAL-SUBST Z" open" 0 ShellExecuteA DROP

but this gave an internal nnCron error... :(
LuckMan212
 
Posts: 133
Joined: Mon, 04 Jul 2005, 11:19

Postby Valery_Kondakoff » Wed, 05 Apr 2006, 12:38

Of course, there is a way... Use au-string with EVAL-SUBST to substitute FOLDER-APP-DATA and the convert it to az-string:

Code: Select all
#( test_scf1
NoActive
Action:
5 0 0 S" %FOLDER-APP-DATA%\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf" EVAL-SUBST S>ZALLOC Z" open" 0 ShellExecuteA DROP
)#
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia


Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 1 guest