Cause for failure to get directory and file

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Cause for failure to get directory and file

Post by kpassaur » Wed Mar 04, 2009 8:36 pm

I was using GetFilelist and was having issues so I changed it to a dos command. As seen below.

RunProgram>cmd /c dir "%foldertobeprocessed%\*.*" /b > "C:\barcodeseparator\Filelist.txt"

It was not a GetFilelist issue. The script works fine on a local PC or a local network with a UNC path or on a Mapped Drive. However it will not work on a WAN.

However, when the Dos Command is run manually (typed at the prompt) it works (provides the file list).

I continued testing with a directory command.
I tested it with a basic dir z:\*.* and sent it to a file, the first two lines are in the text file but that is it. The line saying

"Directory of z:\"

is not there. The only lines in the file are the first two that contain Volume in drive and Volume Serial Number

Any ideas as to what could cause this.

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Mar 04, 2009 9:09 pm

I don't have an idea as to the problem. But one way to possibly diagnose the issue would be to change the Dos cmd line from /c to /k and then run it as a test. /k will leave the Dos window open so you can read any error messages.

RunProgram>cmd /k dir "%foldertobeprocessed%\*.*" /b > "C:\barcodeseparator\Filelist.txt"

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Mar 04, 2009 9:26 pm

Just a few random thoughts....

1. Is the Z drive a compatible format for the DOS DIR command?

2. What if you use Net Use Z: ............ before the DIR command?

3. What was problem/symptom with GetFileList? What was the Result?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

dir command

Post by kpassaur » Thu Mar 05, 2009 8:41 am

Yes it is compatible, I believe it is in my logic. After more testing it is seems to be running when there is a subdirectory present, so it is just not getting the root directory.

So, what I am going to do is continue with the Dos Command (it does work when it is manually entered and viewed) and then write a line in the output containing the root directory.

When this is done I will check for files in the root.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts