windows 7 - vb6 read and write a text file in win 7 -
i trying execute .exe file (created vb6) on windows 7. application create text file, , read text text file. functions being tested on windows xp. when execute .exe file on win 7, functions act usual file created doesn't exist on specific path (c:\test.txt). weird thing can still read content text file (through .exe file) despite being unable find text file on file explorer.
then discovered have choose [run administrator] execute .exe file, file (test.txt) created on c: drive. curious how .exe file can still read text file not existed, , how can force .exe file run administrator?
here coding write , read file.
open "c:\" & "test.txt" output #1 print #1, cdrive.text close #1 open "c:\" & "test.txt" input #1 input #1, msg close #1 cdrive.text = msg exit sub
- i suggest run program administrator using feature in shortcut (after compiling , installing).
- if asked when in debug mode - believe if user use debug admin - it's enough.
- i have no answer question "i curious how .exe file can still read text file not existed"
- you should not specify open #1 directly, use freefile() function instead look here sample.
good luck
Comments
Post a Comment