viewpoint-particle

Author Topic: CreateFile error 53  (Read 2726 times)

bettman

  • Newbie
  • *
  • Posts: 41
CreateFile error 53
« on: February 08, 2017, 05:20:18 am »
I'm receiving the error "CreateFile error 53" when using the following code:

        OutputFile=('\\10.182.2.18\Thinclient\ThinClient.csv')
   PCName = Environment('ComputerName')
   EpicName = RegQueryStr(@RegMachine,'Software\Citrix\ICA Client[ClientName]')
If !FileExist(OutputFile)
   ThinClientInfo = Fileopen(OutputFile,'Write')
   Filewrite(ThinClientInfo,'PCName,EpicName')
   FileClose(ThinClientInfo)
Endif
   ThinClientInfo = Fileopen(OutputFile,'Append')
   Filewrite(ThinClientInfo,'%PCName%,%EpicName%')
   FileClose(ThinClientInfo)

The error is being thrown when hitting the line:
ThinClientInfo = Fileopen(OutputFile,'Write')

I have admin rights on my test machine, and can manually write to the share referenced in the above code. I can also verify that the registry key exists with valid data.
 
If anyone can offer any insight as to why this is failing, I would appreciate it.

td

  • Tech Support
  • *****
  • Posts: 3453
    • WinBatch
Re: CreateFile error 53
« Reply #1 on: February 08, 2017, 07:58:33 am »
Windows system error code 53 is "The network path was not found."  Just because you are admin and "can manually write to the share referenced in the above code" isn't all that significant.  The problems has more to do with the version of Windows you are running the script on, the version of Windows on the system hosting the share, the UAC settings on the system running the script and the share settings on the system hosting the share.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

bettman

  • Newbie
  • *
  • Posts: 41
Re: CreateFile error 53
« Reply #2 on: February 08, 2017, 08:34:09 am »
Currently UAC is off and the device is running Windows 7 embedded. As a test, I created a batch file which did a simple file copy to the same share and it worked. Any thoughts as to what would be preventing the script from seeing/writing tot he share?

td

  • Tech Support
  • *****
  • Posts: 3453
    • WinBatch
Re: CreateFile error 53
« Reply #3 on: February 08, 2017, 08:51:22 am »
Nope.  There is nothing complicated about FileOpen.  It simply calls the same Win32 CreateFile API that almost all other Windows desktop applications call.  It is likely not a share mode issue as that kind of problem would normally generate a different system error code.  Note that "share mode issues" does not refer to shared folder permissions issues but to file share mode read and share mode write as set via IntControl 40. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

  • Tech Support
  • *****
  • Posts: 3453
    • WinBatch
Re: CreateFile error 53
« Reply #4 on: February 09, 2017, 10:50:42 am »
Out of curiosity ran a quick test of the FileOpen on a Windows 7 embedded system.  Didn't have any problems accessing remote shares using the remote host's IP address.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade