Jim Lawrence
accessd at shaw.ca
Tue Nov 5 13:19:38 CST 2013
Hi Darren:
A number of years ago I had a similar issue so I called the a virtual command environment directly:
cmd /k blah blah blah >> LogFile.txt
Question; what is the "Echo" part of the command line being used for? Shouldn't it just read "blah blah blah >> LogFile.txt" ?
Jim
----- Original Message -----
From: "Darren" <darren at activebilling.com.au>
To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com>
Sent: Tuesday, 5 November, 2013 7:31:53 AM
Subject: [AccessD] A2003:BAT/CMD file not outputting to log file if run from VBA
Hi guys
I have a CMD file that is run from VBA.
Inside this CMD file are lines like:
Echo blah blah blah >> LogFile.txt
All good and pretty basic - If I double click the CMD or BAT file the
outputting to the log file via the '>>' works a treat.
If I 'run' the CMD/BAT file from VBA then the file runs but the >> bits seem
to be ignored.
As a result the log file isn't created and (of course) there are no log
entries.
I have tried with CMD and with BAT files
I have tried calling the BAT/CMD file a few ways from within VBA too. All no
joy.
Dim strFileToRun As String
strFileToRun = Me.txtDeployFileToBuildPath
''strFileToRun = "C:\Program Files\Microsoft SQL
Server\90\Tools\Binn\Run.bat"
Dim retval
'retval = Shell(strFileToRun, vbNormal)
Call fHandleFile(strFileToRun, -1)
'Call Shell(strFileToRun, 0)
And so on
Anyone come across this before?
Many thanks in advance
D
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com