tags:

views:

106

answers:

3

Hi , I've asked the very same question here : http://stackoverflow.com/questions/3248008/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 language 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\:

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.

+2  A: 

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

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

adf88
if delphi 7 was available on windows 2008 r2 64bit I would use its debugger.
austin powers
Delphi 7 runs fine on 2008 R2 or use the remote debugger...
Remko
Can you confirm that having two backslashes actually causes any problems at all? I don't think it does. The OS simply treats them as one backslash.
Rob Kennedy
It is the first thing I would check. Eliminate double backslash from the path and check if the application works. Besides, this may be a hint: http://stackoverflow.com/questions/729151/double-backslash-not-work
adf88
+1  A: 

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.

Marjan Venema
I have omit that extra backslash but problem still exist
austin powers
+1  A: 

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.

Uwe Raabe
I have set the permissions of all the corresponding folder to read/write/execute by everyone ,I am not much familiar with delphi and this program was written before and I only have the source code turns out the same exact complied programm runs like a charm on windows 2003
austin powers
@Austin: Which means UAC/Virtualization is getting in the way because as far as I know that was not yet present in MS Windows Server 2003.
Marjan Venema