OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Can you execute a batch file through basic?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
SomeoneHere
OOo Enthusiast
OOo Enthusiast


Joined: 28 Oct 2005
Posts: 116
Location: Boston, Massachusetts USA

PostPosted: Fri Mar 24, 2006 9:15 am    Post subject: Can you execute a batch file through basic? Reply with quote

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
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Fri Mar 24, 2006 9:29 am    Post subject: Reply with quote

See
Call an external program with macro http://www.oooforum.org/forum/viewtopic.phtml?t=6117
shell command - How do I see the results of my shell command http://www.oooforum.org/forum/viewtopic.phtml?t=9503
using shell command in Openoffice version 1.1.4 http://www.oooforum.org/forum/viewtopic.phtml?t=19972&highlight=
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Fri Mar 24, 2006 12:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Sat Mar 25, 2006 9:13 am    Post subject: Reply with quote

I have not studied :
Home Directory http://www.oooforum.org/forum/viewtopic.phtml?t=13506&highlight=

to see if there is a possibility to change the current path. But have a look.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group