alcuin
Group: Members
Posts: 2
Joined: Sep. 2005 |
|
Posted: Jan. 20 2007,18:35 |
|
Took me a long while, but I finally have it.
-- runinvisible.vbs -- Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject") WshShell.CurrentDirectory=fso.GetParentFolderName(WSCript.ScriptFullName)
runbatch = "dsl-base.bat" if (WScript.Arguments.count<>0) then runbatch = WScript.Arguments(0) end if wshShell.Run """"& runbatch &"""",0,False -- end runinvisible.vbs --
Just copy and paste between the dashes into a Notepad file; save the file as "runinvisible.vbs". Copy it to your dsl embedded directory, into the same directory as the dsl-base.bat file. If you double-click on it, it will run dsl-base.bat by default. If you drag and drop one of the other batch files, like dsl-windows.bat, or dsl-pendrive.bat, onto the runinvisible.vbs icon, it will run those instead, but also hide their console windows.
Some notes: 1) This has only been tested on XP SP2, though it should run on W2K. No guarantees yet though, please leave me feedback and lmk how it goes. 2) You must place the runinvisible.vbs file in the same directory as the batch file you want it to run. Before, I had this horrible issue that if I dragged and dropped a file onto it, it would execute the file from the %UserProfile% directory. I have it now set to look for the directory of the .vbs file, and execute the batch file from there. This should be ok, since you'll probably only want to use this script with DSL/QEMU. If you want to use it with anything else, you're free to modify, but you're on your own. I would rather have the script search for the path of the file dropped onto it, but seeing that the argument is passed as a whole, it is rather difficult for me to figure out how to parse out just the path, without the file name. If someone figures it out, please let me know, or modify it and post it. 3) Also as important, this requires a very very small modification to the batch file you intend to run. This has absolutely no adverse affect on running QEMU afaik. You must edit the dsl-base.bat or any other batch file you want to run, and edit the line that starts with
START qemu\qemu.exe -L qemu/ -no-kqemu -m 128 -soundhw sb16 -localtime -kernel linux24 -initrd minirt24.gz -hda KNOPPIX/knoppix -hdb qemu/harddisk .....
and delete out the word START, so you're left with something like
qemu\qemu.exe -L qemu/ -no-kqemu -m 128 -soundhw sb16 -localtime -kernel linux24 -initrd minirt24.gz -hda KNOPPIX/knoppix -hdb qemu/harddisk .....
START causes qemu to be spawned into another process, which the script has no control to keep hidden. Without it, qemu simply runs within the batch file. The one difference is, without start, the cmd window will stay open, in the back-background, but visibly hidden. If you open up task manager, you can see it there, but not on your desktop. Using the START command would prevent it from being in your task manager, but the script would not be able to control the hidden aspect. The script could be completely rewritten to directly call QEMU, which would be the best case scenario; no batch file to cause a command window to stay open. But then the script would be completely tied to DSL and the configuration must be modified within the script. This probably can and will be done in the future, but for now, the script is usuable with most past and present versions of DSL Embedded out there.
|