Files with absolute paths links - How to move them?

videoclocknet

New member
Local time
4:16 PM
Messages
14
Hi guys,

We have been using a labeling software from a laptop with Windows Vista for a long time. In that laptop we have thousands of labels stored that we open and edit with such software. Those labels contain logos of companies as absolute paths, that is C:\...\something.jpg , instead of embedding the image on the file.


Now we have installed such software on newer PCs and moved those files to the new PCs. Consequently, the labels appear with the links to the logos broken.

I don't know how to manage that.

Can you give me a hand?

Kind Regards,

videoclocknet
 

My Computer My Computer

OS
Windows 7 32 bits
Just to say those images are on any folder of the C: unit from the laptop.
There is no a folder that contains the set of images.
 

My Computer My Computer

OS
Windows 7 32 bits
Do you copy to the same folders?
Did you check permissions and ownership?

Or perhaps your program on the old machine keep some paths and other information in some settings file of the sort? Did you check AppData, ProgData etc folders for where the program may keep them?
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1
CPU
AMD Phenom 2 1090T
Motherboard
Gigabyte GA-890FXA-UD5
Memory
2x8GB Kingston HyperX Fury Black 1600Mhz Unganged
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Realtek On-Board HD 7.1 Audio / Logitech G35
Monitor(s) Displays
3xAcer GD245HQ
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro 512GB SSD - OS /
WD Caviar Black SATA 3 - 1 TBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GB - Internal Backup /
Seagate Barracude SATA 3 - 3TB - External Backup/ Sync
PSU
HighPower 1000W
Case
Cooler Master HAF 932
Cooling
Noctua NH-D14
Keyboard
Logitech G19
Mouse
Logitech G500
Internet Speed
100/4 Mbit Cable (100GB quota)
Antivirus
ZoneAlarm Extreme Security / MBAM Pro / MBAE Free / SAS Free
Browser
IE 11 - Firefox - Chrome
Other Info
Logitech F710/ G27/ G940/ Z5500 // TrackIR 5 // Nvidia 3D Surround Vision
The path that contains the labels files in the laptop can be the same as in the newer PCs. No problem with that. In fact, it's one folder in the desktop.

However the path to the images must be different than in the laptop. Because of malpractice, each image is on a different path on the hard drive from the laptop.
 

My Computer My Computer

OS
Windows 7 32 bits
I have hard time visualizing to be honest, perhaps because I am not very familiar with such software.
Can you post some screenshots with some explanation? http://www.sevenforums.com/tutorials/9733-screenshots-files-upload-post-seven-forums.html

Why does the path must be different?

There are 2 sets of files in question, right? A label file and an image file that it is linked to. You can copy the labels to the same C:\folder without issues. Why can't you copy the images to the same places as they were in the original install?
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1
CPU
AMD Phenom 2 1090T
Motherboard
Gigabyte GA-890FXA-UD5
Memory
2x8GB Kingston HyperX Fury Black 1600Mhz Unganged
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Realtek On-Board HD 7.1 Audio / Logitech G35
Monitor(s) Displays
3xAcer GD245HQ
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro 512GB SSD - OS /
WD Caviar Black SATA 3 - 1 TBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GB - Internal Backup /
Seagate Barracude SATA 3 - 3TB - External Backup/ Sync
PSU
HighPower 1000W
Case
Cooler Master HAF 932
Cooling
Noctua NH-D14
Keyboard
Logitech G19
Mouse
Logitech G500
Internet Speed
100/4 Mbit Cable (100GB quota)
Antivirus
ZoneAlarm Extreme Security / MBAM Pro / MBAE Free / SAS Free
Browser
IE 11 - Firefox - Chrome
Other Info
Logitech F710/ G27/ G940/ Z5500 // TrackIR 5 // Nvidia 3D Surround Vision
I've discovered that this type of file is actually an XML, which is easy to read by an application!

So now I would need some scripting that makes the following:

1.- I insert a pendrive to the laptop
2.- Create a folder on the parent folder of the pendrive
3.- For each label file on the laptop,
copy the label file to the just created folder of the pendrive
look for any path inside that file. For each path
Copy the file that is pointed by the path to the just created folder of the pendrive
Rename such path on the new file from the pendrive to W:\name-of-the-image.jpg

4.- On the new PC: create the W: unit drive.
5.- Copy all the files from such folder of the pendrive to the W: unit

I think this would work, right?
 

My Computer My Computer

OS
Windows 7 32 bits
Sorry, Gokay, I didn't see your post.

There are two different types of files as you say: the label files, which are actually XML files. These files have some fields that are paths.

The second type of files are images, which are actually jpg files.

On the first type of files, it is written the path to the second type of files

Sorry for my english. I didn't know how to explain it.
 

My Computer My Computer

OS
Windows 7 32 bits
Hmm, yeah I guess the procedure you laid out should work.
It should be easy to manually do one or two and see if everything is alright.
Then someone here can make a script for you I am sure.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1
CPU
AMD Phenom 2 1090T
Motherboard
Gigabyte GA-890FXA-UD5
Memory
2x8GB Kingston HyperX Fury Black 1600Mhz Unganged
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Realtek On-Board HD 7.1 Audio / Logitech G35
Monitor(s) Displays
3xAcer GD245HQ
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro 512GB SSD - OS /
WD Caviar Black SATA 3 - 1 TBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GB - Internal Backup /
Seagate Barracude SATA 3 - 3TB - External Backup/ Sync
PSU
HighPower 1000W
Case
Cooler Master HAF 932
Cooling
Noctua NH-D14
Keyboard
Logitech G19
Mouse
Logitech G500
Internet Speed
100/4 Mbit Cable (100GB quota)
Antivirus
ZoneAlarm Extreme Security / MBAM Pro / MBAE Free / SAS Free
Browser
IE 11 - Firefox - Chrome
Other Info
Logitech F710/ G27/ G940/ Z5500 // TrackIR 5 // Nvidia 3D Surround Vision
Gokay, I really appreciate your help.

I will test it with one or more files and share the results.
 

My Computer My Computer

OS
Windows 7 32 bits
Ei guys,

1.- I've copied all the .itf files into my pendrive.
2.- After that, I've copied one .jpg image to the pendrive.
3.- I've opened one .itf file from the pendrive with notepad and changed the path to the logo, so now it points to the just copied .jpg image on the pendrive.
4.- I've opened the just modified .itf file of the pendrive from another PC which has the labeling software installed and the newly copied jpg image appears as the logo in the label. So that method works!

Now I need a script that makes the following:
Parameters: [Input folder], [Output Folder]
Algorithm:
(I copy all the itf files to my pendrive before executing this algorithm, so we don't loose the initial files in case of an error)
For each .itf file in [Input folder] and its subfolders, search for any tag called Filename inside the itf file and copy such file to the output folder. Then change the Filename tag of the itf file to [outputfolder\image-name.jpg]


Here is a real example of a Filename tag in a .itf file:
Code:
<FileName>C:\Users\USUARIO 1\Desktop\colos create\LOGOS\avidur.jpg</FileName>

And I attach a real itf file, so you can have an idea of what I'm looking for.
View attachment Lineto T03 D12 N.itf.txt

Can you give me a hand for creating such a script?

Kind Regards
 

My Computer My Computer

OS
Windows 7 32 bits
Try run this in the main itf folder. Shift+right click empty space in explorer in itf folder and select "Open command window here".
Code:
dir /s/b *.itb >listitb.txt
Then open it and copy a few lines here and see how it is.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1
CPU
AMD Phenom 2 1090T
Motherboard
Gigabyte GA-890FXA-UD5
Memory
2x8GB Kingston HyperX Fury Black 1600Mhz Unganged
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Realtek On-Board HD 7.1 Audio / Logitech G35
Monitor(s) Displays
3xAcer GD245HQ
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro 512GB SSD - OS /
WD Caviar Black SATA 3 - 1 TBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GB - Internal Backup /
Seagate Barracude SATA 3 - 3TB - External Backup/ Sync
PSU
HighPower 1000W
Case
Cooler Master HAF 932
Cooling
Noctua NH-D14
Keyboard
Logitech G19
Mouse
Logitech G500
Internet Speed
100/4 Mbit Cable (100GB quota)
Antivirus
ZoneAlarm Extreme Security / MBAM Pro / MBAE Free / SAS Free
Browser
IE 11 - Firefox - Chrome
Other Info
Logitech F710/ G27/ G940/ Z5500 // TrackIR 5 // Nvidia 3D Surround Vision
Hi gokay,

I've opened cmd.exe, moved to the parent folder of the itf files of the pendrive. Then I've executed the following command
Code:
dir /s/b *.itf >listitf.txt

And I've attached the listitf.txt, so you can have an idea. Just to say I've read listitf.txt and it includes all the file names

View attachment listitf.txt

Regards
 

My Computer My Computer

OS
Windows 7 32 bits
Hi Videoclocknet,

Your post #10 is beautifully explained. I wish every member posting here in need of a script would explain their requirement with that much relevant detail: the steps you’d take, arguments the solution script should expect, and a short description explaining the desired algorithm. Well done.

On the Desperateness Scale of 1 to desperate, how quickly would you like to recieve your solution, Vid'? So I’d be able to give a hand in creating that script for you in no time... however I’m actually kind of Windows-less at the moment :), so do expect some delay (probably just a day or two)… Apologies about that.

One important question, Vid’, are you able to run PowerShell scripts? Parsing an XML document would be a slightly tricky stunt to pull off in Batch.
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Pyprohly, I don't know about anything about batch files and the sort, just tried to help OP to get the algorithm right. Was it unnecessary? :)

No idea if this would make a difference, are all jpg files are in one folder or can be in different ones? Do you want them to be in one folder after the move (problem if jpg may have same names) - I hope it is clear.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1
CPU
AMD Phenom 2 1090T
Motherboard
Gigabyte GA-890FXA-UD5
Memory
2x8GB Kingston HyperX Fury Black 1600Mhz Unganged
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Realtek On-Board HD 7.1 Audio / Logitech G35
Monitor(s) Displays
3xAcer GD245HQ
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro 512GB SSD - OS /
WD Caviar Black SATA 3 - 1 TBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GB - Internal Backup /
Seagate Barracude SATA 3 - 3TB - External Backup/ Sync
PSU
HighPower 1000W
Case
Cooler Master HAF 932
Cooling
Noctua NH-D14
Keyboard
Logitech G19
Mouse
Logitech G500
Internet Speed
100/4 Mbit Cable (100GB quota)
Antivirus
ZoneAlarm Extreme Security / MBAM Pro / MBAE Free / SAS Free
Browser
IE 11 - Firefox - Chrome
Other Info
Logitech F710/ G27/ G940/ Z5500 // TrackIR 5 // Nvidia 3D Surround Vision
Hi Pyprohly,

Your support is really appreciated. It's your help, so I'm not going to speak about time limits. ;)

The laptop has Windows Vista. AFAIK, Powershell is not included in Vista by default. However, Microsoft has created a package for installing the version 1.0: https://support.microsoft.com/en-us/kb/928439

Also, I suspect the following link is the update to the version 2.0: Download Windows PowerShell 2.0 and WinRM 2.0 for Windows Vista (KB968930) from Official Microsoft Download Center

I can install those packages if you need.

Regards
 

My Computer My Computer

OS
Windows 7 32 bits
Hi Gokay,

The original location of the jpg files are different between files. However, once those jpg files are copied after running the script, the copied jpg files can be in the same folder (the output folder). In fact, I prefer them to be in the same folder -it's easier to find them.

I forgot to say that they can be jpg files, png files or whatever file type
 

My Computer My Computer

OS
Windows 7 32 bits
In case the algorithm finds more than one image file with the same name, for example logo.jpg, the algorithm can rename the copied jpg file to another name. No problem with that.

For instance, logo.jpg, logo(1).jpg, logo(2).jpg ...

In that case, the algorithm has to change the <FileName> tag of the copied itf file to point to the new name of the image file. For instance:
Code:
<FileName>W:\logo(2).jpg<FileName>

One itf file can contain more than one <FileName> tag -for instance, if the label has several images.
 

My Computer My Computer

OS
Windows 7 32 bits
Wouldn't it be better and more organized if you have, say,

W:\Images\<itf_filename1>\logo.jpg (or other extensions).
W:\Images\<itf_filename1>\logo2.png

W:\Images\<itf_filename2>\logo.jpg
etc.

itf_filename can be read automatically anyway

This way all image files will be in same parent folder but in their own respective sub-folder. Hope this makes sense. :)
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1
CPU
AMD Phenom 2 1090T
Motherboard
Gigabyte GA-890FXA-UD5
Memory
2x8GB Kingston HyperX Fury Black 1600Mhz Unganged
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Realtek On-Board HD 7.1 Audio / Logitech G35
Monitor(s) Displays
3xAcer GD245HQ
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro 512GB SSD - OS /
WD Caviar Black SATA 3 - 1 TBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GB - Internal Backup /
Seagate Barracude SATA 3 - 3TB - External Backup/ Sync
PSU
HighPower 1000W
Case
Cooler Master HAF 932
Cooling
Noctua NH-D14
Keyboard
Logitech G19
Mouse
Logitech G500
Internet Speed
100/4 Mbit Cable (100GB quota)
Antivirus
ZoneAlarm Extreme Security / MBAM Pro / MBAE Free / SAS Free
Browser
IE 11 - Firefox - Chrome
Other Info
Logitech F710/ G27/ G940/ Z5500 // TrackIR 5 // Nvidia 3D Surround Vision
Nice appreciation. It would be beautiful. And definitely more organized


Wouldn't it be better and more organized if you have, say,

W:\Images\<itf_filename1>\logo.jpg (or other extensions).
W:\Images\<itf_filename1>\logo2.png

W:\Images\<itf_filename2>\logo.jpg
etc.

itf_filename can be read automatically anyway

This way all image files will be in same parent folder but in their own respective sub-folder. Hope this makes sense. :)
 

My Computer My Computer

OS
Windows 7 32 bits
Pyprohly, I don't know about anything about batch files and the sort, just tried to help OP to get the algorithm right. Was it unnecessary? :)
Words can't explain how un-unnecessary your assistance was, GokAy. After all, reading the OP by itself, it isn't apparent that the problem involves a certain help, which I can provide. Would have ignored this thread without your reply and your continued influence to the flow of this discussion:

I was equally as confused as you were at post #5, GokAy, some clarification and more details on Videoclocknet’s part was needed then.

Further more, your post #8, GokAy, I would have instructed exactly the same: “how would you do it manually?”

Everything you did was necessary. You’re doing good great exceptional fantastic magnificent, believe me.

No idea if this would make a difference, are all jpg files are in one folder or can be in different ones? Do you want them to be in one folder after the move (problem if jpg may have same names) - I hope it is clear.

Scattered or all in one place--makes zero difference either way.


The laptop has Windows Vista. AFAIK, Powershell is not included in Vista by default. However, Microsoft has created a package for installing the version 1.0 [...] I can install those packages if you need.

No, no. Thats fine. Batch it is.
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Back
Top