The mistery was solved, thanks to
 Code:
@SCRIPTDIR ?
@CURDIR ?
Get $


It appears the @SCRIPTDIR shows the script path (V:), but @CURDIR shows my home path (Z:\) using drag & drop. Running it from command line they show (V:) and (V:\) respectively.

Thank you all for the help, here is the final script if anyone is interested:

 Code:
DIM $objConn, $retcode, $datastring
DIM $sqlserver, $uid, $uidpwd, $sqldb, $sqltable
DIM $userid, $logpath, $openlog, $

If @LOGONMODE = 1
	; Logon Mode is on
	$SO=SetConsole("HIDE")
	Break OFF
	? "Logon Mode is on"
	; Value here should never be 1.
	$openlog = 0
Else
	;Logon Mode is off
	$SO=SetConsole("SHOW")
	Break ON
	? "Logon Mode is off"
	; Value 1 opens log at end of execution, any other does not.
	$openlog = 0
EndIf	
$SO=SetOption("WrapAtEOL", "ON")
$SO=SetOption("Explicit", "ON")
$SO=SetOption("NoMacrosInStrings", "ON")
$SO=SetOption("NoVarsInStrings", "ON")

; ****** VARIABLE DEFINITIONS ***********

; "Username,Date Time,IP,Computer Name, OS, Type,Domain Controller"

$datastring =  "'" + @TICKS + "','" + @USERID + "','" + @DATE + ' ' + @TIME + "','" + @IPADDRESS0 + "','" + @WKSTA + "','" + @PRODUCTTYPE + "','" +Split(@LDRIVE,'\')[2]+"'"
$sqlserver = "server"
$uid = "uid"
$uidpwd = "pass"
$sqldb = "db"
$sqltable = "table"
$userid = Join(Split(@USERID,"."),"-")
$logpath = "%Temp%\log-" + $userid + "-track.log"

; ****** VARIABLE DEFINITIONS  END ***********

$ = RedirectOutput ($logpath,1)

;Load necessary UDFs

Select
	Case Exist ("UDF_DBConnOpen.kix") AND Exist ("UDF_DBExecuteSQL.kix") AND Exist ("UDF_DBConnClose.kix")
		? "SQL UDFs were found in same path as script"
		Call "UDF_DBConnOpen.kix" ;open DB
		Call "UDF_DBExecuteSQL.kix" ;Execute SQL in DB
		Call "UDF_DBConnClose.kix" ;close DB
		GoSub sqlinsert
	Case 1
		? "SQL UDFs not found, exiting script"
EndSelect

; Close the log file
$ = RedirectOutput ("")

If $openlog = 1
	Run "notepad.exe " + $logpath
EndIf


Exit

:sqlinsert
; SQL command execution
$objConn = DBConnOpen('DRIVER={SQL Server};SERVER='+$sqlserver+';UID='+$uid+';PWD='+$uidpwd+';DATABASE='+$sqldb)
If @ERROR=0
	$retcode = DBExecuteSQL($objConn,"INSERT INTO " + $sqltable + " VALUES (" + $datastring + ")")
	If @ERROR <> 0
		? 'Error = '+@ERROR+' - '+@SERROR
	EndIf
EndIf
$retcode = DBConnClose($objConn)
Return