Jump to content

FileWrite in exe doesn't work when VB called


Recommended Posts

Hi Everyone,

Any help would be much appreciated.

The issue that I have encountered is that I initially compiled a .exe autoIT program. When the exe is executed on independently, the program works perfectly.

However I wrote a VB program that calls the autoIT .exe program. Most of the .exe function works except for the FileWrite commands.

---

The VB code is:

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Dim RetVal

RetVal = Shell("C:\Users\Wallace Wee\Desktop\CFS LS\decomp [FINAL].exe", 1) ' Run Decomp

End Sub

And the relevant AutoIt commands are:

...

Send("{CTRLDOWN}a{CTRLUP}")

Send("{CTRLDOWN}c{CTRLUP}")

;C:\Users\Wallace Wee\Desktop\CFS LS\writMe.txt

$fileSize = 0

if FileExists("C:\Users\Wallace Wee\Desktop\CFS LS\writMe.txt") Then

$fileSize = FileGetSize("C:\Users\Wallace Wee\Desktop\CFS LS\writMe.txt")

EndIf

FileWrite("writMe.txt", ClipGet ())

sleep(500)

If $fileSize = FileGetSize("C:\Users\Wallace Wee\Desktop\CFS LS\writMe.txt") Then

FileWrite("writMe.txt", ClipGet ())

sleep(500)

EndIf

---

Please let me know if any additional information is needed.

Many Thanks,

Patrick Lau

Link to comment
Share on other sites

FileWrite("writMe.txt", ClipGet ())

The file will write to the current working directory as shown above. I am going to guess that the file did write and is perhaps in the same directory as you VB app if that was the current working directory at execution.

:)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...