Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Why isn't this file moving????

Posted on 2012-03-19
9
Medium Priority
?
251 Views
Last Modified: 2012-06-27
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
Comment
Question by:gdspeare
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 10

Expert Comment

by:moon_blue69
ID: 37738079
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
 

Author Comment

by:gdspeare
ID: 37738095
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
 
LVL 49

Expert Comment

by:Martin Liss
ID: 37738107
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 10

Assisted Solution

by:moon_blue69
moon_blue69 earned 1336 total points
ID: 37738127
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
 
LVL 10

Accepted Solution

by:
moon_blue69 earned 1336 total points
ID: 37738148
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
 
LVL 49

Expert Comment

by:Martin Liss
ID: 37738170
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
 
LVL 65

Assisted Solution

by:RobSampson
RobSampson earned 664 total points
ID: 37739949
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
 

Author Comment

by:gdspeare
ID: 37741316
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
 

Author Closing Comment

by:gdspeare
ID: 37741320
Wasn't my answer but thanks for the ideas
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question