I use function FILE() as below, it works fine with windows XP, but it executes MsgStop() function with windows 7. On the other words, the FILE() tell me CMD.EXE file does not exist, but it is exist in fact.
FUNCTION Main()
LOCAL cFile := GetSysDir() + "\CMD.EXE"
IF ! FILE( cFile )
MsgStop( "File does not exist!", "Warning" )
ENDIF
RETURN(NIL)
Any help will be much appreciates.
Andy
Help with FILE()
Re: Help with FILE()
Your sample is working fine on my PC running OS Windows 7 - 32 BIT.
Please check the file attribute of the file cmd.exe in your C:\Windows\System32 folder
Regards
Anser
Please check the file attribute of the file cmd.exe in your C:\Windows\System32 folder
Regards
Anser
Re: Help with FILE()
Thank you Anser, my PC running OS Windows 7 - 64 bit.
Is this cause the problem?
Regards,
Andy
Is this cause the problem?
Regards,
Andy
Re: Help with FILE()
Sorry, as of now I don't have a Windows 7 - 64 bit here. Are you experiencing the same problem with files other than cmd.exe ?
Did you check the output of the function GetSysDir() and is it returning the expected output ?
Regards
Anser
Did you check the output of the function GetSysDir() and is it returning the expected output ?
Regards
Anser
Re: Help with FILE()
Anser,
Yes, I have the same problem with files other than cmd.exe, and the function GetSysDir() returns C:\Windows\System32
Regards,
Andy
Yes, I have the same problem with files other than cmd.exe, and the function GetSysDir() returns C:\Windows\System32
Regards,
Andy
Re: Help with FILE()
Andi,
Is GetSysDir() returning "C:\Windows\System32" or is it returning "C:\Windows\System32\" ?
In the second case your test would result into "C:\Windows\System32\\cmd.exe", which, of course, doesn't exist.
Is GetSysDir() returning "C:\Windows\System32" or is it returning "C:\Windows\System32\" ?
In the second case your test would result into "C:\Windows\System32\\cmd.exe", which, of course, doesn't exist.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Re: Help with FILE()
Michel,
The result is "C:\Windows\System32\cmd.exe".
So far as I know, the path is correct, the file is exist. But the result of file() is .F.
I don't know how to fix this problem. Do you have any idea?
Regards,
Andy
The result is "C:\Windows\System32\cmd.exe".
So far as I know, the path is correct, the file is exist. But the result of file() is .F.
I don't know how to fix this problem. Do you have any idea?
Regards,
Andy
Re: Help with FILE()
Andy, do you have correct rights to access to a system dir? Try to execute the test as administrator.tsai8839 wrote:Michel,
The result is "C:\Windows\System32\cmd.exe".
So far as I know, the path is correct, the file is exist. But the result of file() is .F.
I don't know how to fix this problem. Do you have any idea?
Regards,
Andy