WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Create Hard Link

 Keywords:  Hard Link Links CreateHardLink CreateHardLinkA DllCall mklink

Question:

How would I create a Hard Link using WinBatch?

Answer:

You could shell-out and use mklink or use something like the following
strNew = "C:\Temp2\HardLink.txt"
strExisting = "C:\Temp\Test.txt"
bResult = DllCall("Kernel32.dll", long:"CreateHardLinkA", lpstr:strNew, lpstr:strExisting, long:0)
If !bResult Then Message("System Error", " Reported last error = ":DllLastError())

Article ID:   W17918
Filename:   Create Hard Link.txt
File Created: 2013:09:24:13:48:26
Last Updated: 2013:09:24:13:48:26