|
-
Dec 19th, 2006, 02:04 PM
#1
Thread Starter
Addicted Member
[RESOLVED] wait until execute
how can i delay the function
insword
until the the previous shell executes
VB Code:
'open command prompt to run Python script
Open Apath & "dos.bat" For Output As #1
Print #1, "cd C:\python24"
Print #1, "buckwalter2unicode.py -i C:\newfile.txt -o C:\newoutfile.txt -E mbcs"
Close #1
Shell Apath & "dos.bat"
insword
-
Dec 19th, 2006, 02:35 PM
#2
Re: wait until execute
Won't this be finished when "C:\newoutfile.txt" is created? If so, do it in a Do Loop.
-
Dec 19th, 2006, 02:59 PM
#3
Thread Starter
Addicted Member
Re: wait until execute
Yes it will finished when "C:\newoutfile.txt" is created
OK
how can i check its existing before opening it in the function insword
if file exist then open it
do while "newoutfile.txt" exist
Open "C:\buckwalter_morphan_1\data\newoutfile.txt" For Input As #ff
tmp = Split(Input(LOF(1), 1), vbCrLf)
loop
-
Dec 19th, 2006, 03:11 PM
#4
Re: wait until execute
God no!
Check for file existence with the DIR command
VB Code:
Do While Dir("Yourfilename")=""
DoEvents
Loop
-
Dec 19th, 2006, 04:03 PM
#5
Thread Starter
Addicted Member
Re: wait until execute
thanks randem
but this didn't work because
the shell command will write to the file newoutfile.txt
and the do while will execute the function just after creation and befor finish writing
which will give me unwanted output
so how can i start insword after writing to file
-
Dec 19th, 2006, 11:48 PM
#6
Re: wait until execute
Well, after you detect the file then you attempt to gain exclusive access.
Will the file be a specific size when created?
-
Dec 20th, 2006, 12:26 AM
#7
Re: wait until execute
Dear om-yousif,
Have a look at this thread
Please mark you thread resolved using the Thread Tools as shown
-
Dec 20th, 2006, 02:23 AM
#8
PowerPoster
-
Dec 21st, 2006, 02:25 PM
#9
Thread Starter
Addicted Member
Re: wait until execute
thanks danasegarane
its exactlly what i need
but how can i hide the command prompt window
i don't want it to be visible to the user
-
Dec 21st, 2006, 02:44 PM
#10
Re: wait until execute
Shell it with vbAppWinStyle set to vbHide.
-
Dec 21st, 2006, 02:51 PM
#11
Thread Starter
Addicted Member
Re: wait until execute
???? gavio ?????
i'm new in VB
what did you say
-
Dec 21st, 2006, 03:19 PM
#12
Member
Re: wait until execute
Hi om-yousif...
I think U can write like this:
VB Code:
' ShellAndWait Apath & "dos.bat"
Shell Apath & "dos.bat", vbHide
-
Dec 21st, 2006, 05:15 PM
#13
Re: wait until execute
Why not just ShellandWait???
-
Dec 22nd, 2006, 06:59 AM
#14
Thread Starter
Addicted Member
Re: wait until execute
Thanks everyone i used shellandwait
thanks again for your help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|