OK.. I think we need to revisit a couple of things here..

You are doing a MOVE, which means that you are taking a file and moving it to another name. So, how can nk2view act on the file when it is renamed or moved to another name?

Debugging is a cinch in KiX.. You can initiate a debug on in your script.. You can then look at the resulting @error and @serror macros to see what is going on.

Also, you can do kix32 /d yourscript.kix

This stuff is discussed in the FAQ Forum..

So.. Here is what I have put together so far (still not working, but closer):

 Code:
BREAK ON
CLS
DIM $servername, $nk2, $profilepath, $searchstring, $sharepath, $programpath, $cmdstring, $runline, $cmdline
 ;
 ;Edit Variables
 ;
 $servername = ho00060lp57
 ;For example $ServerName = "Server1" or "Server1.yourdomain.com"
 $AppD = ReadValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'AppData')
 ???$AppD
 $profilepath = $AppD+"\Microsoft\Outlook\"
 ;For example $ProfilePath = "%USERPROFILE%\Application Data\Microsoft\Outlook\Outlook.NK2", or "Null"
 $searchstring = "test@test.com"
 ;-------------------------------------------------------------------------------------------------------------------------------------------
 ;-------------------------------------------------------------------------------------------------------------------------------------------
 $sharepath = @scriptdir + "\"
 ;$sharepath = "\\" + $servername + "\nk2view\"
 $programpath = $sharepath + "nk2view.exe"

 ;This section fills in the default NK2 path
 IF NOT EXIST($profilepath)
       $profilepath = "%USERPROFILE%\Application Data\Microsoft\Outlook\Outlook.NK2"
 ENDIF

 IF EXIST($AppD+'\Microsoft\Outlook\*.bak'+@YEAR+@MONTHNO+@MDAYNO+@TIME)
       RETURN ; RETURN maybe better than EXIT as RETURN takes you back to where left off
 ENDIF

 IF EXIST($AppD+'\Microsoft\Outlook\*.nk2')
       ;Searches for files ending with .NK2 and creates backup.
       ; -- You want to do a copy to backup before messing with the file...
       debug on
       ???'"'+$profilepath+'*.NK2'+'"'
       CD $profilepath
       COPY '"'+'*.NK2'+'"' '"'+'*.bak'+'"'
       ;COPY "MyDir\file*.txt" "MyDir\file*.bak"

       ???@SERROR+@ERROR
       ;MOVE $AppD+'\Microsoft\Outlook\*.nk2' $AppD+'\Microsoft\Outlook\*.bak'+@YEAR+@MONTHNO+@MDAYNO+@TIME
       $cmdstring = $programpath + "/nk2file " + $profilepath
       $runline = $cmdstring + " /delete " + $searchstring
       SHELL $runline
 ENDIF

get $


HTH,

Kent


Edited by Kdyer (2008-06-26 10:57 PM)
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's