Topic Options
#31492 - 08/06/09 05:44 PM See if File Exists
Nikki Offline
OL Newbie

Registered: 05/13/02
Posts: 17
I'm attempting to use the Run Script condition using VBScript and the Script.ReturnValue to see if a file exists. The script runs without error but Script.ReturnValue always evaluates False even if the file exists. I'm not very familiar with VBScript so any help is appreciated or is there an easier way to check if a file exists as a condition?

Here is the VBScript:

Set objfso = CreateObject("Scripting.FileSystemObject")
Script.ReturnValue = objfso.FileExists("C:\Program Files\PlanetPress Suite 7\ERROR")

Top
#31493 - 08/06/09 06:01 PM Re: See if File Exists
Anonymous
Unregistered


Hi Nikki,

We have a custom plugin here that is named "file exists.dll". As you can tell, it does exactly what you are looking for. Please send me a private message with your email address so I can provide it to you, since it is not available on our website.

Note that such a plugin will NOT be supported and you use it at your own risk. I use it all the time so do not worry.

Regards,

Olivier

Top
#31494 - 08/07/09 08:24 AM Re: See if File Exists
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1931
Loc: Objectif Lune, Montreal, Qc
Nikki,

Your code is correct. Have you tried running it from the Configuration tool in debug mode?

Are you sure your file is really called ERROR, with no extension?

Also, make sure the user under which the PlanetPress Workflow Tool runs has the appropriate rights to read in that folder.

Let us know if that resolves the issue.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#31495 - 08/07/09 10:46 AM Re: See if File Exists
Nikki Offline
OL Newbie

Registered: 05/13/02
Posts: 17
Thanks guys... I sent my email address to get the plugin but I also double checked the file permissions and folder permissions and did some tweaking on those and the VBScript does work! I was so certain it was the VBScript since I really had no idea what I was doing!! I did run it in debug and it never really gave me any useful information. Do I need to set some debug level to see more useful information? This is what I received when it ran the Run Script condition.


Starting plugin Run Script - 09:34:34
Run embedded script...
Data file processed : debug39CD64D.dat, size: 4950 bytes
Plugin Run Script completed successfully - 09:34:34

Top