Saved Bookmarks
| 1. |
Solve : Shortcut with folder name? |
|
Answer» Perhaps you don't realise that every time you do a cd.. command, the current directory changes? Naming the shortcut is not the problem. It is where it puts the shortcut. I have TRIED using you formula but I just cant seem to get a shortcut in the current directory. Below is my directory structure So why don't you specify where you want the shortcut to be created? e.g. D:\Users\tertom01\Desktop\BatchFiles\mkshortcut /target:"%cd%" /shortcut:"D:\Users\tertom01\Desktop\BatchFiles\6568\dwg cont\working\Ref" This will create a link in the folder "D:\Users\tertom01\Desktop\BatchFiles\6568\dwg cont\working". The link will be called "Ref.lnk" The link will point to whatever folder %cd% is at the time the BATCH script is run. Finally figured it out. See below. Believe it or not I thought about this for hours. But I find my self starting to understand how variables and such thing WORK. thanks again for you time SALMON Trout. @echo off cls set a=%cd% cd ..\ cd ..\ mkdir "Drawings-Uncontrolled\Ref" CD "Drawings-Uncontrolled\Ref" for %%A in (".") do set b=%%~nA D:\Users\tertom01\Desktop\BatchFiles\mkshortcut /target:"%cd%" /shortcut:"%a%\%b%" |
|