wernerh
Goto Top

Mein Titel Aus einer Batch in einem Ordner einen Link aus einem anderen Ordner erzeugen

Hi,
ich möchte mit einem Batchbefehl einen Link in einem Ordner auf einen anderen Ordner erzeugen. Wer kennt eine Lösung?
Vielen Dank im Voraus

Werner

Content-Key: 32190

Url: https://administrator.de/contentid/32190

Printed on: April 19, 2024 at 10:04 o'clock

Member: cykes
cykes May 11, 2006 at 06:51:04 (UTC)
Goto Top
Hi,

es gibt ein Tool aus dem NT Resource Kit namens "Shortcut.exe", kannst Du z.B. hier
runterladen: http://wwwbzs.tu-graz.ac.at/~fleischh/computer/unattend/software.html

Das sollte auch unter aktuellen Betriebssystemen funktionieren.

Gruß

cykes
Member: wernerH
wernerH May 11, 2006 at 07:17:50 (UTC)
Goto Top
Hi cykes,
vielen Dank für deine schnelle Antwort.
Einen Link auf einen Ordner habe ich mit dem Tool nicht hingekriegt, es scheint vor allem für Programmlinks geeignet.

Gruß
Werner
Member: lionel
lionel May 12, 2006 at 14:02:37 (UTC)
Goto Top
Hallo ersteinmal !

Betreffend:
ich möchte mit einem Batchbefehl einen
Link in einem Ordner auf einen anderen
Ordner erzeugen. Wer kennt eine
Lösung?
Vielen Dank im Voraus

Das Kommando "linkd" (aus dem "MS-Windows Server 2003 Ressource Toolkit" - kann von Microsoft heruntergeladen werden), meistert genau dieses Vorhaben.

Beispiel aus dem Hilfesystem dazu:

Windows Resource Kit Tools Help

LinkD Examples
Overview | Remarks | Syntax | Examples | Related Tools Open Command Prompt



Example 1: Create a Link From a Folder to a Target Object
To get a listing of all files in the root directory of C:\folder, type the following at the command line:

dir

Press ENTER. Output similar to the following is displayed:

Directory of C:\folder
10/21/2002 04:33 PM <DIR> .
10/21/2002 04:33 PM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 12,460,773,376 bytes free
To change to the D drive, type the following at the command line:

d:

Press ENTER. To change to the DOCS folder on the D drive, type the following at the command line:

cd DOCS

Press ENTER. To list the files in the DOCS folder on the D drive, type the following at the command line:

dir

Press ENTER. Output similar to the following is displayed:

Directory of D:\DOCS

08/23/2001 05:00 AM <DIR> .
08/23/2001 05:00 AM <DIR> ..
08/23/2001 05:00 AM 22,398 PRO.TXT
08/23/2001 05:00 AM 6,859 READ1ST.TXT
08/23/2001 05:00 AM 39,045 RELNOTES.HTM
08/23/2001 05:00 AM 6,895 WINXP_LOGO_HORIZ_SM.GIF
4 File(s) 75,197 bytes
2 Dir(s) 0 bytes free
To return to the Folder directory on the C drive, type the following at the command line:

C:

Press ENTER. To create a link at C:\Folder\Ddrive to the D:\DOCS folder, type the following at the command line:

linkd Ddrive D:\DOCS

Press ENTER. Output similar to the following is displayed:

Link created at: Ddrive
To test the new link, type the following at the command line:

cd Ddrive

Press ENTER. To list the contents of Ddrive, type the following at the command line:

dir

Press ENTER. Output similar to the following is displayed:

Directory of C:\folder\Ddrive

08/23/2001 05:00 AM <DIR> .
08/23/2001 05:00 AM <DIR> ..
08/23/2001 05:00 AM 22,398 PRO.TXT
08/23/2001 05:00 AM 6,859 READ1ST.TXT
08/23/2001 05:00 AM 39,045 RELNOTES.HTM
08/23/2001 05:00 AM 6,895 WINXP_LOGO_HORIZ_SM.GIF
4 File(s) 75,197 bytes
2 Dir(s) 0 bytes free
Notice that the contents of Ddrive are the same as the contents of the D:\DOCS folder.

Example 2: Create an NTFS Junction Point to Your Desktop
Type the following at the command line:

linkd YourDeskTop "<Your Profile> \desktop"

Note

<Your Profile> can be the path or %UserProfile%.
Press ENTER. Output similar to the following is displayed:

Link created at: YourDeskTop
Notes

Use NTFS Access Control Lists (ACLs) to protect junction points from inadvertent deletion.
Use NTFS ACLs to protect files and directories targeted by junction points from inadvertent deletion or other file system operations.
Never delete a junction point using Explorer, a del /s command, or other file system utilities that walk recursively into directory trees. These utilities affect the target directory and all subdirectories.
Use caution when applying ACLs or changing file compression in a directory tree that includes NTFS Junction Points.
Do not create namespace cycles with NTFS or DFS junction points.
Place all your junction points at a secure location in a namespace where you can test them out in safety, and other users cannot mistakenly delete or change them.

Ich hoffe Dir damit weitergeholfen haben zu können! Windows-Server 2003 Ressource Kit Tools laufen auch auf Windows-XP-Maschinen!!!

M.f.G.
- MARTIN -
Member: wernerH
wernerH May 15, 2006 at 12:10:07 (UTC)
Goto Top
Hallo Martin,
vielen Dank für Deinen ausführlichen Beitrag. Mit dem Tool habe ich bisher etwas erreicht, das in etwa dem Subst unter DOS entspricht.
linkd d:\test c:\test1
Ich sehe danach den Inhalt von Test1 im Ordner D:\test
Ich möchte aber in einem Ordner für viele Benutzer Links auf mehrere andere Ordner anlegen. Natürlich nacheinander.
Bisher habe ich das nicht hingekriegt - wenn ich unterhalb eines Ordner den Verweis auf einen anderen anlege, dann spiegelt sich der Ordner unendlich rekursiv.
Linkd d:\test\test1 c:\test1
Vielleicht hast du ja noch eine Idee.
Vielen Dank für Deine Bemühung
Werner
Member: wernerH
wernerH May 15, 2006 at 12:35:12 (UTC)
Goto Top
Hallo Martin, die zweite

wenn ich aus dem Ordner Test den Befehl folgendermaßen aufrufe:
D:\test> linkd test1 c:\test1
D:\test> linkd test2 c:\test2
funktionierts.
Ich finde dann unter D:\test\test1 den Inhalt von c:\test1 und unter D:\test\test2 den Inhalt von c:\test2.

Danke nochmals
Werner