SOLVED A Win10 shortcut .lnk file within a batch file doesn't give the correct path

Joined
Apr 11, 2021
Messages
1
Reaction score
0
I haven't messed with batch files in years but I"m having a few issues with this one. I fly a flight simulator on my HP Omen desktop PC that requires very hi-res scenery. Along with that they're usually very large in size, well into the GB's per file. So to save space on the HD my simulator software resides on I've moved all these hi-res images onto another dedicated hard drive and folder then I use the "create shortcut" option within Win10 to create shortcuts to these images on this dedicated drive. So far so good...so I thought. To simplify my life a little by changing the resolution of the simulator I want to swap/delete the shortcut .lnk files to change the resolution when I wished and I wanted to automate the process via a batch/cmd file.

Here is part of the routine in the batch file I've created that shows trying to copy the .lnk files from one HD to the drive containing the simulator files.

@echo off
cls
:X-Plane HD_UHD Meshes
cls
echo.
echo This will remove any ortho4XP link files you have in your Custom Scenery folder (if any)
echo and will remove your scenery_packs.ini file. However, your scenery_packs.ini will be replaced.
echo If you see a File Not Found error that just means you are not NOW using Ortho4XP
echo links but another choice above so disregard that error message.
echo Just...
echo.
pause
cls
echo You're about to remove some link files and your scenery_packs.ini file to
echo enable the HD-UHD X-Plane textures.
echo.
echo If you want to abort this process press CTRL+C. Otherwise....
echo.
pause
cls
cd E:\X-Plane 11\Custom Scenery\
del *.lnk
del scenery_packs.ini
echo.
echo Files have been deleted.
pause
cls
echo Your old scenery_packs.ini and any link files are history.
echo We're now going to copy the scenery_packs.ini file and the HD-UHD links to your Custom
echo Scenery folder to enable the HD-UHD textures for X-Plane.
echo.
pause

Here's the routine I created to copy the files. There is one .ini file in the folder and three .lnk files in the same folder that I wanted to copy to the drive of the simulator, the E:\ drive.

cd F:\Custom Scenery\X-Plane HD-UHD Scenery_Packs.ini and Mesh Files\
xcopy "scenery_packs.ini" "E:\X-Plane 11\Custom Scenery\"
xcopy "*.lnk" "E:\X-Plane 11\Custom Scenery\"


cls
echo Now let's see if the files are there....
echo.
pause
cd "E:\X-Plane 11\Custom Scenery\
dir /p *.ini
echo.
echo Good for the scenery packs.ini....
echo.
pause
cls
dir /p *.lnk
echo Good for the HD-UHD link files....
echo.
pause
cls
echo You're good to go on running X-Plane with the HD-UHD textures.
echo.
pause
goto end

What I'm finding out is the path Win10 creates in the shortcut .lnk is NOT to the image file shortcut links on my F:\ drive but to my C:\user\user_name\Downloads folder. Yet I can double click on a shortcut link and it takes me directly to the correct drive letter, folder and file. Here's a few screencaptures as to what I'm seeing. And when the routine checks as to whether the files are there or not it shows an .ini file I do have in my downloads folder but it isn't related to the file I need linked to.

Wrong Path For Shortcuts .jpg


Wrong Path For Shortcuts #2.jpg



This has me stymied. Would appreciate any tips as to what I may be doing wrong from the batch file gurus....

Thanks,

Rod
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top