View Full Version : Gk : When encoding complete : do *action*
aicha24
3rd January 2008, 15:01
First of all, I did search on this board and google but couldn't find any solutions to my problem.
I'm looking for something to be able to let scripts (batch / vbs / ...) execute after Gordian Knot has done with encoding.
The only option I know of is to shut down Gordian Knot when done with encoding, but I want to be able to set my own custom scripts instead.
Any help would be greatly appreciated.
Thanks in advance
Aicha
Brother John
3rd January 2008, 19:49
The only direct way is get the source code and add that functionality to GK itself.
aicha24
3rd January 2008, 21:32
I found the sourcode of Gordian Knot at this (http://gordianknot.cvs.sourceforge.net/gordianknot/gknot/Source/) url.
So basicly it would be possible to add or modify this action and than recompile it ?
I also found ShutDown.pas (http://gordianknot.cvs.sourceforge.net/gordianknot/gknot/Source/ShutDown.pas?revision=1.5&view=markup), if someone could code my request in this part of code instead of shutting down your pc it would run another script I guess ?
Anyone here that would be able to do this or that knows how I could contact the developers of GK ?
unskinnyboy
3rd January 2008, 22:17
I haven't tried it myself, but I believe you can call a vbs script from inside Delphi (what GK is written in). You'll need Windows Script Control + something like this (http://www.scalabium.com/smscript.htm) OR write the equivalent of your VB Script in Delphi and put it inside ShutDownWindows() of Shutdown.pas, so that inside of shutting down Windows, the functionality of your code will be run.
Brother John
4th January 2008, 00:01
A simple ShellExecute() should be enough. However I’m not familiar enough with the GK sources to implement it quickly.
Kurtnoise
4th January 2008, 10:23
Anyone here that would be able to do this ?
I can do it...
Kurtnoise
4th January 2008, 22:25
http://kurtnoise.free.fr/index.php?dir=misc/&file=GK_20080104.zip
The checkbox to "Shutdown Windows" has been removed. So you need to go to the Options tab to select what you want...
To load a batch or script file you need to make a double click on the edit area just under the combobox.
ps1 : Build not tested. :D
ps2 : Patch included in the package.
aicha24
8th January 2008, 01:55
First of all, I'd like to thank Kurtnoise13 for the special build / patch. It's working but I still have some questions (see below).
I 'installed' the build by unpacking the files to my default gordian knot directory, thus overwriting the default exe. Can you confirm this is the proper way to do it ?
After that I tested some scripts to see if and how it would work. When selecting a vbs file there doesn't seem to be any problems, after encoding it gets executed just fine. With .bat files however, there will only be a command windows that opens and no script executes.
Both of these scripts have very simple code and create a folder 'HelloWorld' to my encoding directory :
@echo off
REM test.bat
mkdir C:\encoding\HelloWorld\
' Some code I found using google to create a folder with VBs
' Create a Folder
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.CreateFolder("C:\encoding\HelloWorld\")
Do you have any idea why batch scripts aren't executing ? This problem could be solved by using another script to let a VBs script execute the batch script, but this isn't a 'proper' solution in my opinion.
Kurtnoise
8th January 2008, 20:34
I 'installed' the build by unpacking the files to my default gordian knot directory, thus overwriting the default exe. Can you confirm this is the proper way to do it ?
yes, it is...
Do you have any idea why batch scripts aren't executing ?
yes...give me a couple of minutes to fix that.
*click me* (http://kurtnoise.free.fr/index.php?dir=misc/&file=GK_20080108.zip)
aicha24
13th January 2008, 00:45
Hmmm sorry I'm moaning again but this second build is giving me the exact same result. After encoding a cmd window titled '\default\install\path\cmd.exe' will open with the dir '\path\where\gk\saves\its\files\after\encoding\' in.
Maybe it has something to do with the way i'm using it ?
Thanks again
Kurtnoise
13th January 2008, 09:18
Should be fine now...:)
http://kurtnoise.free.fr/index.php?dir=misc/&file=GK_20080113.zip
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.