Jump to content
Macro Express Forums

Query On Wildcard With 'if File Exist' Command


troyg

Recommended Posts

Hi There,

 

Wondering if anyone can please assist with this problem we are having? We are using WinZip Command Line interface to create zip files for our clients. However, sometimes it appears to get tied up and when it does, leaves a .TMP file in the directory. However, the first few letters will change, for example being WZ123.tmp or WZ007.TMP etc . . . we've been created a loop, to try and find out if there is a *.TMP file in the directory, however the ‘If File Exist’ command doesn't allow wildcards, so we can't search for *.TMP.

 

Does anyone know how we could work around this?

 

We would greatly appreciate any help!

 

Cheers - Troy

Link to comment
Share on other sites

Sure. Simply do the repeat with folder to return file a file name and test to see if it contains the string "*.tmp" or whatever. Simply do arepeat with folder and then use another string to accumulate the results. Just keep appending to the accumulator and at the end see if it contains *.tmp. Somehting like this:

 

<REP3:07:000001:000001:0001:0:01:c:\><TMVAR2:08:02:01:000:000:><ENDREP><IFVAR2:1:02:7:.tmp><TBOX4:T:1:CenterCenter000278000200:000:ErrorDanger Will Robinson!><ENDIF>

Link to comment
Share on other sites

Hi,

 

I used to have a problem with an application generating TMP files on startup. I used ME to check for these files and delete them. This is some time ago and I am not 100% sure, but I believe I had ME check for files with the .TMP extension and delete them. This worked. I don't know why the help says you can't use wildcards with "if file". I believe you can. Just let ME search that directory for "*.TMP". I think this will work. I just wrote a simple test macro which looks for "*.ini" files in a specific directory. I these exist, Notepad should launch. It does. If I change the .ini extensions in that directory, Notepad doesn't launch.

 

Arthur

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...