Xcopy

Michael Mantkowski michaelj at clientrax.com
Sat Oct 12 16:15:18 UTC 2024


Hi Brian,

Several ways to do it.

Here is one. I am creating a batch file and then executing it. Does more
than just the xcopy but it will give you a idea.


;  Setup .bat File

;  Get Windows Version
Calculate pvCommandLine as con(pvCommandLine,'ver','  >
',kDq,lvReturnFile,kDq,' 2>&1',kCr,kLf)

;  Close Omnis so that we can copy files from it.
Calculate pvCommandLine as con(pvCommandLine,'if exist
%WINDIR%\sysnative\taskkill.exe (%windir%\Sysnative\taskkill.exe /f /IM
omnis.exe /fi "WINDOWTITLE eq ClienTrax*") Else (taskkill.exe /f /IM
omnis.exe)','  >> ',kDq,lvReturnFile,kDq,' 2>&1',kCr,kLf)
Calculate pvCommandLine as con(pvCommandLine,'timeout 1','  >>
',kDq,lvReturnFile,kDq,' 2>&1',kCr,kLf)     ;; Give 1 Second to close
ClienTrax

;  Delete any files we no longer want on the local workstation
Calculate pvCommandLine as con(pvCommandLine,'del
',kDq,inProgramFolder,'external\idletime.dll',kDq,'  >>
',kDq,lvReturnFile,kDq,' 2>&1',kCr,kLf)

;  Get Files from Server
Calculate pvCommandLine as con(pvCommandLine,'xcopy
',kDq,inDataFolder,'Update',kDq,' ',kDq,inLibraryFolder,kDq,' /y /s','  >>
',kDq,lvReturnFile,kDq,' 2>&1',kCr,kLf)
Calculate pvCommandLine as con(pvCommandLine,'Start ',kDq,'ClienTrax',kDq,'
/max ',kDq,inProgramFolder,'Omnis.exe',kDq,'
',kDq,inLibraryFolder,'ClienTrax.lbs',kDq,'  >> ',kDq,lvReturnFile,kDq,'
2>&1',kCr,kLf)
Calculate pvCommandLine as con(pvCommandLine,'ECHO Program Finished  >>
',kDq,lvReturnFile,kDq)

;  Write .bat file
Do lvFileObj.$createfile(lvBatFile) Returns lvError
Do lvFileObj.$openfile(lvBatFile) Returns lvError
Do lvFileObj.$writecharacter(kUniTypeNativeCharacters,pvCommandLine) Returns
lvError
Do lvFileObj.$closefile()

Breakpoint {For Development Mode - Troubleshoot Close Loop - Can trace back
why this is being called over and over.}
;  Run .bat file
Call DLL
("Shell32.dll",con('ShellExecute',pick(inU,'A','W')),0,"#NULL#",lvBatFile,"#
NULL#","#NULL#",0) Returns lvError
Clear method stack
Quit method



*********************************************************************
Michael Mantkowski
ClienTrax Software
1-614-875-2245
*********************************************************************


-----Original Message-----
From: omnisdev-en On Behalf Of Wayne Germann
Sent: Saturday, October 12, 2024 11:24 AM
To: Omnis List <omnisdev-en at lists.omnis-dev.com>
Subject: Xcopy

Hello All,

Has anyone used Xcopy in "Launch Programs" or "Start Program Normal" command
in Studio?  I believe it must start with "CMD" somehow first but can't get
the command laid out correctly.

Thank,
Brian



_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com Start a new
message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list