开发者

I have a delphi 7 program running on windows 2008 and I get "folder does not exist" error

I've asked the very same question here : Why does my program say "folder does not exist" when run on Windows 2008?

but none of the answers were satisfying and my problem still exists , so I decide to ask it in another way with more detail cause this problem really irritate me and we need to solve this , otherwise we have to write the similar application in another lang开发者_如何学Cuage which means waste of our time.

program written in delphi 7(32 bit)

environment running this program is : windows 2008 r2 64-bit

the task program try to do : creating 3 folders then copy an sound file and compress it using lame commmand line (lame.exe) and save changes into database

error I get : "THE 'folder' does not exist . the file might have been moved or deleted , Do you want to create it?" and it cause the program become halted

things I have done :

1- try to run the program as an administrator

2- check eventlog but no clue

3- triple check the required folder and all of them was correct

4- read this KB: http://support.microsoft.com/kb/927387

BUT still I am seeing this bloody error.

I have uploaded the picture of the error here as you see it clearly : http://i28.tinypic.com/9to6qr.jpg

The folder name is C:\Upload_ABC\\2010\07\27\:

I have a delphi 7 program running on windows 2008 and I get "folder does not exist" error

please notice I haven't written that unwanted dialog-box inside my program I believe windows 2008 attach it or bring it on my application.

please please please give me some idea or let me know what should I do ?

best regards.


C:\Upload_ABC\\2010\07\27\

You have two backslashes in your path. Use debugger to see why.


Have you checked the access rights for that folder structure with regard to the account the Delphi program is running from? Windows Server systems tend to be more restrictive in what a user is allowed to do than Windows on workstations are.

In addition I suggest to strip down a copy of the program to the relevant functionality to show the error. With this you get at least a chance that anyone around may test it on another system.

Furthermore you can try to compile it with D2010 and see wether the error persists. If it does, you might have a chance to find the problem running the D2010 debugger. If you don't have D2010 at hand, you might install the trial just for this purpose.


What is between the two consecutive backslashes in your path? Is there really nothing between them or have some characters been removed because they are Unicode and D7 doesn't support Unicode?


As there is nothing in between the two consecutive backslashes...

It does sound like Windows is getting its grubby little fingers in between your program and your access of the files. Either the folders have not been created, or you are being denied access once they have. And as the changes you are trying to store in your database involve compressed files, virtualization seems to be the culprit as explained by the link you yourself provided.

A couple of avenues to try:

  • Remove any compatibility settings on your exe (right click|properties|Compatibility tab) that could trigger Windows to butt in. Also don't forget this can be triggered by things like "setup" or "update" as part of the executable name.

  • "Save your application's data in a folder under your user profile." Such as c:\users\\documents or some such (better not hardcode it in actual production code, but ok for debugging). That after all is exactly the advice the linked msdn article is giving for scenario 2 "you cannot find the files or folders you just created"

  • If you can't debug on the machine where it is running, go back to old school debugging: add trace messages to your code to show where in the code you are (and have been) and show them in a memo on a separate form or some such.

  • Make sure you don't "eat" any exceptions that could give you extra information about what is going on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜