• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

Why isn't this file moving????

I am trying to run a pretty straight forward vbs script which at the end moves the file to a different directory.  I am getting a file not found error on line 84.

What am I missing here?
SendToEE.txt
0
gdspeare
Asked:
gdspeare
  • 3
  • 3
  • 2
  • +1
3 Solutions
 
moon_blue69Commented:
Hi

if its not moving push it harder - simples! - lol

i can se you are acceccing the destination as a UNC Path. Can you try manually accessing that path by typing in

\\prwinie001\f$\s1_prod\fr_coderyte_EX\queue\

at the run prompt. at that location try to create a file manually to see if you can create one.

What I am pointing is, could be a simple permission error.
0
 
gdspeareAuthor Commented:
Thanks.  I'm not having an issue writing to the UNC path.  I'm having an issue moving when it comes to moving to the processed folder.
0
 
Martin LissOlder than dirtCommented:
I assume that fso.MoveFile currfile, "F:\Production\CodeRyteProcessed\Testing" is line 84.

Have you placed a breakpoint on that line and looked to see the value of currfile?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
moon_blue69Commented:
two things

1.

If fso.GetExtensionName(File)="hl7"Then - is it reading the actual value from H17 , is it case sensitive?

1.

procdir = "f:\Production\CodeRyteProcessed\" & "_" & fso.GetFileName(file) - Seems like you are inserting an _ in the file name.

Does the file names start with an _ is it required?
0
 
moon_blue69Commented:
Hi

Its advisible to make use of msgbox to display whats being read as you can see if its getting the desired effect.

Like the concatenated file name etc..
0
 
Martin LissOlder than dirtCommented:
Why use MsgBoxes when you can use Debug? Here's an article I wrote on the subject. It's aimed at VB6 but it will work with VBA.
0
 
RobSampsonCommented:
One thing you must do is either have a trailing slash on the target folder, or you must specify the target file name.

So either use
fso.MoveFile currfile, "F:\Production\CodeRyteProcessed\Testing\"

or
fso.MoveFile currfile, "F:\Production\CodeRyteProcessed\Testing\" & fso.GetFileName(currfile)

Also, move file does not support overwriting, so if the file exists, it will fail.  You need to either delete the target file first, or use CopyFile with overwrite, then delete the source file.

Regards,

Rob.
0
 
gdspeareAuthor Commented:
I can't believe that I missed this.  My currfile was not a full UNC path.  I was trying to delete a file that didn't exist.  I needed to add the directory qualifier and it worked like a champ.
0
 
gdspeareAuthor Commented:
Wasn't my answer but thanks for the ideas
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now