Purpose
These (file_mover
) are helper scripts that are not part
of the system as such. The purpose is to solve the situation where the
LC-MS instrument computer is not reachable by the QC system but they can
both access a shared network drive. This windows batch script can be
used to copy the .raw folders to the network drive and is written to
wait for the analysis to finish.
These scripts are written for Waters’ .raw folder and should
not be used directly for anything else.
I advise against using this script if you are not able to
double-check what it is doing yourself and make sure you have backups
before you try it.
What the script is meant to do:
- Monitor when a run is done.
- Will check if the filename (really a folder name) has the expected number of delimiters.
- If the filename is in the right format the file will be
moved (that is deleted from the original location!) to the
given location.
THIS IS POTENTIALLY DESTRUCTIVE. BACKUP BEFORE TESTING!!!
This script was written for the metabolomics group at NEXS and there are therefore specific parsing of the filename to decide the destination folder. - The first string before the first delimiter is used as the project
name and a project folder is create such that the file
%infolder%\test-pro_pos_test-sample-metstd.raw
will be moved to%outfolder%\test-pro.raw\Data\test-pro_pos_test-sample-metstd.raw
- Optionally symlinks can be made from the original location to the destination folder. This way you can still access the file as if it was still in the original place even if it is actually access in the destination location. So you can open the file normally in the instrument software that expect the file to exist at the original location.
-
Optionally the above mentioned symlinks can be cleared by
running a script
(
file_mover/clear_symlink_folders.bat
).
Usage
Copy the content of the
file_mover
folder to the instrument computer where the .raw “files” are located.-
Edit the top part of
win_waters_mover.bat
to point to the right folders and the settings you want.-
infolder
andoutfolder
are the source and destination folders respectively. - Like the QC system the file move expects to be able to parse
information from the file name. So
delim
sets the character that separates the information. -
expect_delims
states how many delimiters to expect in a filename. This is used to only parse files with the expected filename convention. - If
symlinkback
is TRUE a symbolic link will be made in the original location pointing to the destination location.
-
-
If you use symlinks you need to:
- Right click on Start → Run and launch “secpol.msc”.
- Open “Security Settings” → “Local Policies” → “User Rights Assignment” and select “Create symbolic links”.
- Click “Add User or Group…” → enter the username the system normally uses → click “Check Names” → Click “OK” → Click “OK”
- Reboot or log out and log in again (or run “gpupdate/force” on the command-line as administrator).
Edit
monitor_folder.bat
to point to the same input folder as inwin_waters_mover.bat.
Run
enable_monitor_at_startup.bat
. This should make the folder monitor start at reboot. A console windows will be visible if this worked (after reboot).If you used symlinks you can always remove all symlinks by running
clear_symlink_folders.bat
. Edit to set the location first. This should be same location asinfolder
inwin_waters_mover.bat
.