| View previous topic :: View next topic |
| Author |
Message |
SomeoneHere OOo Enthusiast

Joined: 28 Oct 2005 Posts: 116 Location: Boston, Massachusetts USA
|
Posted: Fri Mar 24, 2006 9:15 am Post subject: Can you execute a batch file through basic? |
|
|
This is the only way that I can figure out how to do this. Bascially I have a calc file that connects to a database. It makes some queries off of the database and puts the information into the spreadsheet. I have also written a batch file that will ftp this file from a LAN back to our office. Is there a way that I can run a bat file using basic macros? Is there a command that lets you run a command outside of calc? _________________ OOo 2.3.1, Windows XP when required, rather use Ubuntu 7.10 |
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8984 Location: Lexinton, Kentucky, USA
|
Posted: Fri Mar 24, 2006 12:10 pm Post subject: |
|
|
Here are some Windows examples of things that do and do not work for me using OOo Basic's Shell command.
| Code: | Sub Main
'This works where the path to NotePad is for Win98:
'Shell("C:\Windows\NotePad.exe c:\freetrak.bat")
'end
'With this FreeTrak.exe throws an error indicating it
'can't find one of its files. It's looking in the OOo
'directory instead of its own.
'Shell("C:\FreeTrak_64\FreeTrak\FreeTrak.exe")
'end
'This works where FreeTrak.bat consists of:
'%1
'cd%2
'FreeTrak.exe
Drive = "C:"
Directory = "\FreeTrak_64\FreeTrak"
PassParameters = Drive & " " & Directory
Shell("C:\FreeTrak.bat",,PassParameters)
End Sub |
|
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
|