1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Inexplicable behavior difference in nearly identical shortcuts

Discussion in 'Support' started by Steve Fabian, Nov 15, 2011.

  1. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    I have two desktop shortcuts which are nearly identical, see below. Both change screen size to 1024x768 using external program QRES.EXE successfully, and supposed to change screen saver timeout - the first to 1000s, the second to 15s. Only the Shortcut 2 changes the screensaver timeout. Using %+ or & in Shortcut 1 instead of ^ (my default since 4DOS for command separator) made no difference. Note that SHRALIAS is already loaded when either one is invoked, and there may be active TCC session (fully initialized, explicitly specifying the command separator character), or no TCC.

    Shortcut 1

    Command=F:\JPSOFT\IR\tcc.exe
    Arguments=/I /H /L: /C ( F:\UTIL\qres.exe /v /x:1024 /y:768 ^ set _dummy=%@winsystem[17,1] ^ set _dummy=%@winsystem[15,1000] ^ exit )
    DirectoryDescription=Set screen size to 1024x768
    Link=C:\Documents and Settings\All Users\Desktop\1024 acs3.lnk
    Icon=C:\WINDOWS\system32\SHELL32.dll
    Offset=22
    Mode=1
    Hotkey=Shift-Ctrl-Alt-3


    Shortcut 2

    Command=F:\JPSOFT\IR\tcc.exe
    Arguments=/I /H /L: /C ( F:\UTIL\qres.exe /v /x:1024 /y:768 ^ set _dummy=%@winsystem[17,1] ^ set _dummy=%@winsystem[15,15] ^ exit )
    DirectoryDescription=15-s screensaver
    Link=C:\Documents and Settings\All Users\Desktop\Screensaver Instant acsD.LNK
    Icon=%SystemRoot%\system32\SHELL32.dll
    Offset=109
    Mode=1
    Hotkey=Shift-Ctrl-Alt-D
     
  2. Rodolfo

    Joined:
    May 20, 2009
    Messages:
    213
    Likes Received:
    0
    What happens if You try the same commands at the command prompt?

    What do You get if You type

    echo %@winsystem[14] & echo %@winsystem[15,15] & echo %@winsystem[14]

    to get previous value, change to the wished one, and get the new one?

    Regards

    Rodolfo Giovanninetti
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    From: Rodolfo
    | Originally Posted by Steve Fabian
    || I have two desktop shortcuts
    |
    | What happens if You try the same commands at the command prompt?
    |
    | What do You get if You type
    |
    | echo %@winsystem[14] & echo %@winsystem[15,15] & echo %@winsystem[14]
    |
    | to get previous value, change to the wished one, and get the new one?

    Thanks for the question. From the command line there is no problem, everything works as expected. The issue is that I want to combine two actions - change of screen resolution and change of screensaver timeout - into a single desktop shortcut, usable whether or not there is a TCC instance active. Each of my 5 similar shortcuts performs the first action correctly, but only one of them does BOTH. The other 4 require using another shortcut (not mentioned before) that correctly performs the second action alone. The question I raised was why only 1 of the 5 works correctly, but the other 4 fail to do ALL they are supposed to?
    --
    Steve
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    They aren't by any chance set to run as administrator, or under different user's credentials, are they? Screen saver settings are per-user....
     
  5. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    From: Charles Dye
    | Originally Posted by Steve Fabian
    || The question I raised was why only 1 of the 5 works correctly, but
    || the other 4 fail to do ALL they are supposed to?
    |
    | They aren't by any chance set to run as administrator, or under
    | different user's credentials, are they? Screen saver settings are
    | per-user....

    No to both. All were created using the SHORTCUT command, which does not support "run as" or alternate credentials. I am always logged into WinXP SP3 as a user with administrator rights. All shortcuts of interest are in the "All Users" desktop directory.
    --
    Steve
     
  6. Steve Pitts

    Joined:
    Jul 7, 2008
    Messages:
    158
    Likes Received:
    0
    Steve,

    I realise that this is likely teaching my grandmother to suck eggs, but have you tried changing the parameters such that the TCC sessions remain active and visible and ECHOing the results from the @WINSYSTEM functions rather than just swallowing them?? Perhaps one of them is failing for some reason.

    Alternatively, why not create a batch file that takes the relevant parameters and invokes the three commands replete with error handling that keeps the session active and unhides the window??
     
  7. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    Also, have you tried delaying for a second or two after calling QRES, or launching QRES with START /WAIT? Or changing the screen-saver settings before the resolution?
     

Share This Page