Author Topic: (Would Be) Trivial VBScript Help  (Read 5739 times)


  • Posts: 1247
(Would Be) Trivial VBScript Help
« on: 14 Oct '06 - 06:13 »
So, um... I'm simply trying to create a VBScript to run a bunch of apps on demand. It's almost like Startup/autostart, only that I want to be able to do it a while after booting.

Two of the files are t1.lnk and t2.lnk. Their path is in %PATH%. These have the following command lines:

C:\WINDOWS\system32\cmd.exe /U /k C:\Shortcuts\tail.exe -f "s:\program files\raidenftpd\log\Aberrant.log"
C:\WINDOWS\system32\cmd.exe /U /k C:\Shortcuts\tail.exe -f "s:\program files\Abyss Web Server\log\access.log"

(I have to use cmd.exe /c or /k (no difference here) for the /U (Unicode output) switch here.)

At first I made a .bat


but I encountered these problems:

t1 and t2 start in a CMD.EXE window, thus not getting their customised Shortcut colour and font settings, plus, they do not end up as two processes; t2 takes over the output. The other two apps open fine.

CALLing these does the same thing.
START does indeed fix the process thing, however, t1 and t2 still run in regular CMD.EXE windows, and thus they do get the same font, window size and colour settings. Not good.

So, abandoning .BAT, I tried to make a .VBS like thus:

Set WshShell = WScript.CreateObject ("WScript.Shell")
WshShell.Run "t1.lnk"
WshShell.Run "t2.lnk"

It absolutely doesn't work. It does try to run the files somehow because it fails silently. I have also tried adding absolute and relative paths, enclosing it all in "proper" parentheses, etc. All examples I have found on the 'Net claim the "obvious" way will work. It does not.

My .LNK filetype is not corrupt. It's as it should be.

Any ideas? What process handles .LNKs, explorer.exe? I've tried running explorer.exe with these .lnks as arguments and it kind of works, only that I get one of those sucky Security Warnings, and I have to press Open manually. Or is it rundll32.exe or something?

I even tried some really insane command lines like trying to run the shortcuts with explorer with cmd /c, but of course that didn't work either.

I can't believe it's supposed to be this goddamn quirky to just automatically start a few shortcuts. I guess it's not that taxing to go <Win+R>, t1, <Enter>, <Win+R>, t2, <Enter>, but this is 2006; I shouldn't have to. This is really pissing me off.
« Last Edit: 14 Oct '06 - 06:45 by Tsorovan »


  • Posts: 1247
Re: (Would Be) Trivial VBScript Help
« Reply #1 on: 14 Oct '06 - 06:31 »
OK, I came up with a work-around now. By doing

START "AbyssWS Log" t1.lnk

I can now have separate window settings (window title-based).
I'd still like to know how to run shortcuts via VBScripts if someone knows, though, for future reference (I guess START works...).
« Last Edit: 14 Oct '06 - 06:46 by Tsorovan »