|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Run-time error 53
Need help with a simple problem. I am supplied with a file of integer numbers. From within
Visual basic 6.0, I sort the file as follows Shell "command.com /C type K:\Recycler\temp|sort>K:\Recycler\TEMP1", vbHide this is quick and dirty, but works well. I then try to open the file to read and get the run time error 53 "file not found". The file is there as I can open it with notpad. But program wise it not there. this is the code I use to read the file. I am trying to load list box. Thanks in advance Open "K:\Recycler\TEMP1" For Input As #1 Do While Not EOF(1) Line Input #1, buf c.AddItem buf Loop Close #1 |
|
#2
|
|||
|
|||
|
When calling a shell command, VB executes the shell and immediately continues on to the next line of code.
If this happens to be your open command, the file might not have been created in time but it will be there when you close your program and use notepad. I usually put a few seconds delay in after the shell command. for example at start of sub, put in Dim TimeOut as long after shell command put in TimeOut = Timer + 5 'for 5 seconds do until timer>TimeOut loop hope that helps |
|
#3
|
|||
|
|||
|
My question is can't setup when occur Error 53...
Hi Strod
My question is: Occured "Visual Basic 5.0 Setup Toolkit Run-time Error '53' File Not Found" windows and setup terminated when I setup my software. Please advise how to solve? Regards, May |
|
#4
|
|||
|
|||
|
As suggested by strod, try to give some delay.Also the reason of error is due to file usage.i.e The file may not have been closed after creating it.Some applications like World behave absurdly, they exist but program denies its existence.Close the file, free its handle and then your code would read it.
|
|
#5
|
|||
|
|||
|
how to write a exe file to patch
Quote:
Hi Cirus, It is a software had been installed in system and this software using VB6.0, but my software is using VB5.0 it is why meet error 53. I can fix it using this way: copy the program which had been setup successfully to this PC Sysytem which occured error 53, and copy COMCT232.ocx file to C:\windows\system32\, then execute C:\windows\system32\regsvr32 COMCT232.OCX under DOS. Now i want to write a EXE file as a patch to execute these two steps to make my software work well. Do you know how to write a EXE file to execute 'copy COMCT232.ocx file to C:\windows\system32\, and execute C:\windows\system32\regsvr32 COMCT232.OCX under DOS' automatically? Thanks Regards, May |
|
#6
|
|||
|
|||
|
For running an EXE in DOS environment, you can use ShellExexuteEX ( Extended version) that has more options.
If you need to run your exec through batch file using DOS shell there is a commad that at this moment i am not able to recall.I did similar thing in DOS shell.I 'll check up that command . |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Run-time error 53 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|