Re: directory listing, mp3 files



CD "C:\Program Files\PostgreSQL\8.1\bin"
dropdb misc
createdb misc
psql misc < "C:\dump.sql"

Using your code, would it be possible to do this inside VB? Currently
I have to shell a new comand prompt then pass the code one line at a
time via sendkeys. It would be much easier if I could send the code
all at once and also be able to know what the command prompt responds
with.

Since Shell can only process one command line, it would appear no. However,
I can think of two possible ways to approach the problem (never tried either
of these myself). One approach would be to set up a DOS batch file as a
template (using DOS variables for the directory and filename), you could
probably execute the batch file from the Shell command and, as part of the
argument to the Shell command, pass in the appropriate text strings for the
batch file to use. Another possible approach would be to create a batch file
on the fly... open the file, Print# the above lines into it, close the file,
force flush the file to the hard drive (I'm pretty sure there is an API for
that), wait for the operation to complete and then run a Shell statement to
execute the newly created batch file (deleting it when done).

Rick


.



Relevant Pages

  • Re: Application starts too soon
    ... each shell internal implementation. ... >>> The application runs froma a batch file. ... >>> shutdown command times out and the computer is ready to be turned off. ... >>> think the app tries to run, encounters an error, and exits. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Test script
    ... What you want to do is call your program from the shell, ... file or a shell script / batch file so that it automatically makes the ... If you are considering using Test::Unit to do the automation, ... I wrote up some examples of using 'dust' a while ago here: ...
    (comp.lang.ruby)
  • Re: Launch a .bat file with VBA
    ... Thanks Tom. ... That seems to run the batch file, ... the Shell function runs other programs ... shell command to launch programs, but that doesn't seem to be working ...
    (microsoft.public.excel.programming)
  • Re: Environment Space in XP
    ... As soon as you 'run' your batch file the 'Shell' containing those settings ... You cannot set up a DOS environment like that unless you execute an app ... When I executed a DOS box, it again showed 'Out of environment space' but I ...
    (comp.lang.clipper)
  • how to get vba to wait until a shell command has completed
    ... I'm using a batch file "catff.bat" to concatenate a bunch of files. ... Catff.bat is called from Word using the shell command, ... macro will go into an infinite loop. ...
    (microsoft.public.word.vba.general)