Darren DICK
darrend at nimble.com.au
Tue Jan 9 18:16:04 CST 2007
Hi Jim Brilliant But I found the culprit (Me) - Says he very embarrassed I am not sure why but the calling code for the batch file was copied and pasted in the same module twice many many lines beneath the first Complete waste of half a day - though I have learned a bit about debug Thank you and Stuart for your efforts Many thanks Have a great day Darren ------------------ T: 0424 696 433 -----Original Message----- From: Jim Lawrence [mailto:accessd at shaw.ca] Sent: Tuesday, 9 January 2007 3:59 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A2003:Shell opens 2 DOS windows Hi Darren: The process is fairly simple. Once you have created a file with one letter in it for simple purposed say it is 'A'. This is done in notepad as it adds no extra bytes for formatting. 1. Now save the notepad created file under the name return.txt into a specific directory like c:\temp 2. Start>run>'cmd' <enter> to get to the command prompt. 3. Navigate to the temp directory. 4. debug return.txt <enter> 5. -d <enter> 'Displays the first 128 bytes. Notice the first byte is 41 which it a capital 'A' in hex. 6. -e 0100 <enter> 'You will see the following 7. xxxx.0100 41. 'You write 0D, for return. 8. xxxx.0100 41.0D '...and then press <enter> 9. -w <enter> to write the changes back to file. 10. -q <enter> to quit the debug mode. Now you have a file called return.txt with a single unprintable object, a return. Now you can use this file as to provide a 'return' value as if was manually performed like so: Darren.bat < c:\temp\return.txt HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK Sent: Monday, January 08, 2007 6:05 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A2003:Shell opens 2 DOS windows Way over the top of my head - I am a luddite Thanks anyway Darren ------------------ T: 0424 696 433 -----Original Message----- From: Jim Lawrence [mailto:accessd at shaw.ca] Sent: Tuesday, 9 January 2007 12:58 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A2003:Shell opens 2 DOS windows Hi Darren: Debug has a number of commands options. The debug /? Or the help debug commands no longer product anything useful but if you go to http://www.microsoft.com/technet/archive/msdos/comm2.mspx?mfr=true there is a definitive list options and parameters. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK Sent: Monday, January 08, 2007 4:51 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A2003:Shell opens 2 DOS windows Hi Jim This looks really interesting When I went to a DOS window (In the same folder I created the return.txt file) and typed 'debug return.txt' (without the quotes) the DOS window changed size and I was presented with a new line and what looked like a hyphen ( - ) at the beginning o the new line. I was able to type stuff there but hitting 'enter' yielded an error and after typing in 0D there was no way to save this and I did not see the expected Hex 41 Did I do something wrong? Many thanks Have a great day Darren ------------------ T: 0424 696 433 -----Original Message----- From: Jim Lawrence [mailto:accessd at shaw.ca] Sent: Tuesday, 9 January 2007 11:19 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A2003:Shell opens 2 DOS windows Hi Darren: This is an old suggestion from the DOS days but I was wondering if the batch file needed a carriage return to start it running. The old method worked something as follows: Given your batch file name is Darren.bat then a file named return.txt would be created. First create a txt file named return.txt with one letter/number in it, like a capital 'A' and save it. Then edit the file using the DOS debug command: 'Debug return.txt', at the command prompt and edit the 'A' now shown as hex '41' to a Return hex value of '0D'. Then save the return.txt file and exit. Now the return.txt file can be used as a Return value provider, at the command prompt like: Darren.bat < return.txt The previous is a simple sample but very complex value provider files can be created as well HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK Sent: Monday, January 08, 2007 3:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A2003:Shell opens 2 DOS windows Hi Stuart The batch file works fine if I double click it by the way Just not if I issue the Shell Command to it from Access - the batch file and its path are not the issue - I don't think >> What are in strFileName and the batch file? String File name is the path to the batch file - it is all cool Again - the batch file works fine and as desired if double clicked but not when Shelled to by Access The batch file is full of repetitive lines like... (xml_creation.rb is a Ruby App we wrote ourselves) xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10113 xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10114 xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10115 xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10116 xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10117 xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10118 xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10119 xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10120 xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10121 xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10122 xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10123 echo **10123 done** xml_creation.rb -t TA -a sqlserver -h SERVERNAMEHERE -d DBNamehere-u sa -p PASSWORDHERE -i 10124 Many thanks Have a great day Darren ------------------ T: 0424 696 433 -----Original Message----- From: Stuart McLachlan [mailto:stuart at lexacorp.com.pg] Sent: Monday, 8 January 2007 8:48 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A2003:Shell opens 2 DOS windows Wjhat are in strFileName and the batch file? On 8 Jan 2007 at 8:35, Darren DICK wrote: > I use the line below to open and 'run' a batch file > > Call Shell(strFileName) > > Can anyone tell me why 2 dos (Command) windows open? > > The syntax is valid - everything is cool - but 2 of them open up and then > start trying to process the lines in the batch file > > And no. There is not some second call buried elsewhere in the code -- Stuart -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com