Script can't access network hard drive

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JensHaglof
Posts: 81
Joined: 04 Jul 2017, 11:41

Script can't access network hard drive

Post by JensHaglof » 03 Oct 2022, 04:54

Hello. I have this script:

Code: Select all

UpdateFile:
FileCopy, G:\Docs\BD\BD.png, C:\Apache24\htdocs\BD.png, 1
sleep, 5000
Goto UpdateFile
Nothing happens.

G:\ is a network hard drive.

If I change it to:

Code: Select all

FileCopy, C:\Apache24\htdocs\BD.png, C:\Apache24\htdocs\BD2.png, 1
Then it works.

I've tried to add Enable linked connections in RegEdit but it still doesn't work. I've tried Run as Administrator, doesn't work either.

I've also tried

Code: Select all

If !FileExist("G:\Docs\BD\BD.png") {
 MsgBox, 48, Error, Not found.
 Return
}
and it says that the file doesn't exist.

Anyone know what might be wrong? If I paste the file path in Explorer the picture opens. So the path is valid.

/Jens

JensHaglof
Posts: 81
Joined: 04 Jul 2017, 11:41

Re: Script can't access network hard drive

Post by JensHaglof » 03 Oct 2022, 05:15

Oh I solved it!!!

I put the script in the same folder as the picture (on the network hard drive) and coded it like this:

Code: Select all

UpdateFile:
Pict:= "\BD.png"
FileCopy, %a_scriptdir%%Pict%, C:\Apache24\htdocs\BD.png, 1
sleep, 5000
Goto UpdateFile

Post Reply

Return to “Ask for Help (v1)”