Main Forum > General Computer Support
Unable to create the log file path
zvit:
I have no issues about unicode but right before the repairs I get a warning that the repairs won't be repaired because Program is unable to create the log file path. Who cares if it can't create logs? I don't mind to do the repairs without the log! I even ran a "Take ownership" script on the log location and it's NOT read only.
Shane:
Can you post a screen shot of the actual message and what the log file path is?
The reason it says the repairs wont run (They might actually) is because in the cmd.exe scripts I have the commands set to output to the log files, so Windows is doing it at that point and I dont know if the cmd.exe will execute the command it is doing if it cant write the log. I know when the log file is in use it wouldn't do the command so I assume it wont do the command if it cant write the log as well.
The program lets you set the log file path in the settings, try changing the log path to something easier like C:\Logs :wink:
Shane
zvit:
I had already tried different log paths on different drives and am getting the same result. Like I said, it actually DOES run the fixes, even after the warning, so I did all the fixes that have to do with taking ownership of drives and registry - hoping that this was causing the error message - restarted the computer and tried again but got the same error message. Attached are the shots.
p.s. yes, the computer is in Hebrew but as you see in the screen shot, the log path I set has no unicode in it. Also, even if it did, I have the "Language for non-unicode programs" set to Hebrew so that shouldn't be the issue.
Shane:
The path does look fine, I take it the D:\ drive is just another local disk?
The program uses the API MakeSureDirectoryPathExists
http://msdn.microsoft.com/en-us/library/windows/desktop/ms680352%28v=vs.85%29.aspx
And the code is simple, this is the actual code
--- Code: ---lResult = MakeSureDirectoryPathExists(sLogPath)
DoEvents
If lResult = 0 Then
MsgBox "UNABLE TO CREATE LOG FILE LOCATION!" & vbCrLf & vbCrLf & "Repairs will fail if they can not output to the log file." & vbCrLf & "Make sure there are no Unicode chars in the path and that the program has permissions to that path.", vbCritical
End If
--- End code ---
So for some reason MakeSureDirectoryPathExists is returning 0 (0 = False, 1 = True)
Do any logs ever end up in that folder or does it stay empty?
Shane
zvit:
Yes, the code seems ok. No, it does not end up creating the log file.
It actually states:
--- Code: ---DirPath [in]
A valid path name. If the final component of the path is a directory, not a file name, the string must end with a backslash (\) character.
--- End code ---
Maybe you need to add the back-slash like this?
MakeSureDirectoryPathExists(sLogPath &"\")
Just a thought.
If it were MY code (or open source) I'd add (just to test) the GetLastError function, hoping to get more info on the error. I would also debug using a breakpoint at that function and use F8 to step into it.
Anyway, thanks for the reply!
Navigation
[0] Message Index
[#] Next page
Go to full version