WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: pguild on January 12, 2025, 11:00:17 AM

Title: FileGet needs help?
Post by: pguild on January 12, 2025, 11:00:17 AM
FileGet(filename) constantly fails with the error message "Error opening file."
Before giving the FileGet I have verified that filename exists. Also, I can open the file easily with Notpad or with the file option in Winbatch studio.  Note that the file lives on an external USB drive called EasyShare.
The .exe lives in the same directory as the file I am trying to get the text from.

Here is a code snippet.

  if fileexist("Message.txt")
     data = fileget("Reminder.txt")
     Vmessage = data
  else
     Vmessage = ""
  endif

;  fileput("Message.txt",Vmessage)
;endif
Title: Re: FileGet needs help?
Post by: pguild on January 12, 2025, 11:39:25 AM
Oops. FileGet does not need help. I do. An obvious error in the code (that I need to be able to see) caused the problem. I checked for the existence of one file and then tried to get the contents of another file, which did NOT exist.