Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Run Object for to move a file by lookout

Help me folks.
 
In my application, Lookout 6.0.2 creates per work shift, a folder named Servos.csv. In order to know what date was, lookout creates a tree like: C:\Database\Servos\Unit x\2006\Mar\16\Shift 3\Servos.csv. So far so good. Now, the second step is to move or to copy out these data folders to a drive in the company network, like J:\Elect\PWC\Database\Servos\..........Shift 3\Servos.csv. I can create a second object to do the same in the J drive or just to set the existing one to J drive, but this is not the point. The requirement is TO MOVE or TO COPY, the file once is completed, from inside C drive to outside somewhere in the network.
 
I tried the run object with the copy command, but it doest do the movement. There is an alarm that tells me that the file wasn't found. Why?
 
Whatever way, or trick, or twisted method that works will be welcome. I just need that lookout moves or copies out the data files.
 
Thanks in advance.
0 Kudos
Message 1 of 13
(5,058 Views)
The following thread has a solution; uses the RUN object with "cmd" and "move" commands. 
 
 
I just verified the above to work in 6.0.2 as well. 
 
NOTE:  if either source or destination paths have non 8.3 filenames, i.e., spaces in them or are longer than 8 characters -- which appears to be the case with you --, then enclose the two paths in two double-qoutation marks (wierd, I know).  Here's an example: 
 
"cmd /c move /y ""C:\temp\move us\*.*"" ""\\faraway\temp\move here"""
 
Copy the above statement into Notepad so you can study the actual number of quotation marks required. 
 
Hope this helps.
 
-Khalid
0 Kudos
Message 2 of 13
(5,050 Views)

I just tried these path in the Run Object:

"cmd /c move /y c:\data\servos\uxlx\2006\mar\17\shift2\*.* G:\Data\Servos\UxLx\2006\Mar\17\Shift2"

According to your recomendation, this statement should work.

It does not accept to modify the statement to:

""cmd /c move /y c:\data\servos\uxlx\2006\mar\17\shift2\*.*"" ""G:\Data\Servos\UxLx\2006\Mar\17\Shift2""

or to:

"cmd /c move /y c:\data\servos\uxlx\2006\mar\17\shift2\*.*" "G:\Data\Servos\UxLx\2006\Mar\17\Shift2"

Notes:

1.- G:\ is a network drive. In order to double check that this computer account has the permissions to create a file there, I created the file from this computer in the G:\ network drive. It works Okay.

2.- When the pushbutton that triggers the run object is pressed (with the very first statement above), a very quick black screen appears and disappears (I assume this is the Dos screen), and there is not alarms.  No file is moved or copied out.

3.- I made sure that the folder I want to copy or to move is no been fed with new data. The Spreadsheet object was directed to save its data to a new location. This releases the folder created before.

4.- Rater than to move, I would prefer to copy the file in C:\ to the network drive.

What else we can try?

0 Kudos
Message 3 of 13
(5,043 Views)

As I had mentioned earlier, you want to embed the two paths in two quotation marks.  This should work: 

"cmd /c move /y ""c:\data\servos\uxlx\2006\mar\17\shift2\*.*"" ""G:\Data\Servos\UxLx\2006\Mar\17\Shift2"""

Let us know how it goes.

-Khalid

0 Kudos
Message 4 of 13
(5,041 Views)
I copied your statement from the reply and pasted into the object command line window, it was accepted by the object.... but didn't work.

Then, I created a switch object to trigger the run object rather than a pushbutton. No change, the black screen came on and off very quickly, just that.
 
Finally I changed the destination to somewhere else in C:\, it didn't work either.
 
I hope you got more tricks under your sleeve.....
 
 
0 Kudos
Message 5 of 13
(5,037 Views)

I mapped a network folder as G: drive, created all the folders you have, exactly as they are on both my C: drive and the G: drive.  And, please believe me,  the above command moves the files just fine!  I am attaching my LKS file.  Can you try with this?

If that still doesn't work, can you try the following from a DOS command prompt:

move /y c:\data\servos\uxlx\2006\mar\17\shift2\*.* G:\Data\Servos\UxLx\2006\Mar\17\Shift2

Note: there are no quotation marks in the above statement.  If even this doesn't work, then let us know the error DOS returns. 

Thanks,

-Khalid

 

0 Kudos
Message 6 of 13
(5,033 Views)

Try this modified example attached, and copy any csv file you have to: C:\Data\Servos\UxLx\2006\Mar\17\Shift2. CSV files are not allowed to be attached. Now the run object is set to move from C to another place of the same C. Your example DIDN'T WORK, so I changed the computer and played with your example (with Lookout 6.0.2). I had no results yet.

 

Thanks for your efforts.

0 Kudos
Message 7 of 13
(5,029 Views)

Still works for me! 

I guess the only we to find out the problem is to try the command from the DOS prompt. 

Regards,

-Khalid

0 Kudos
Message 8 of 13
(5,025 Views)

Hello again.

What I just discovered playing with DOS commands (in windows XP SP2 computers), is that either COPY or MOVE commands don't create destination subdirectories. In other words, in order to have a successful copy or move execution, the destination subdirectory tree must exist first. I have then to play a little bit with the command "MD" through the run object in lookout BEFORE to execute a copy.

Did your computer create the whole destination subdirectory tree when the move command was executed?

Anything else I should know about all this?

0 Kudos
Message 9 of 13
(5,023 Views)
Windows XP still has the xcopy command - it copies files and directory trees.  xcopy /? gives you all the parameters and flags, but something like 'xcopy /s source destination' should create directories as part of the copy.
0 Kudos
Message 10 of 13
(5,020 Views)