[RESOLVED] Simple question - How to call open a file?
Hi all,
Simple question - I've tried the solutions that i've seen using search on this forum (incidentally, the search function keeps lagging out and/or crashing my browser..) but I can't get it working; I keep getting errors.
Simply, how can I open a fixed-name / location file from within VB code?
So say I have "C:\Update.bat" (it's a batch file that I'm trying to open). What's the exact code to open "C:\Update.bat" ?
I've tried:
Code:
Shell "Start /wait " & "Update.bat"
and
Code:
Shell "Start /wait C:\Update.bat"
Thanks :)
Re: Simple question - How to call open a file?
do u want to open to read the file or do u want to run the file?
to open and read the file use this code
VB Code:
open "c:\update.bat" for input as #1
do while not eof(1)
input #1, myString
text1.text=text1.text & vbcrlf & mystring
loop
close #1
to runt the file just use
Re: Simple question - How to call open a file?
Ah! Perfect (To open the file to execute it). Thank you!