Windows Symlink & working directory
up vote
4
down vote
favorite
I have a directory called apps/myapp/
with a file myapp.exe
which uses myapp.dll
and some other dlls.
Now lets say i want to symlink this to a directory, like one would do in linux.
bin/myapp.exe
=> verylongpath/myapp/myapp.exe
. Ie using mklink bin/myapp.exe verylongpath/bin/myapp.exe
Now when i run the myapp, it's yelling against me that it can't find the dll. which means that the exe isn't run against its own working directory. Which makes me sad.
Is there somehow i can make it run in ints own working directory? Thanks!
windows symbolic-link mklink
add a comment |
up vote
4
down vote
favorite
I have a directory called apps/myapp/
with a file myapp.exe
which uses myapp.dll
and some other dlls.
Now lets say i want to symlink this to a directory, like one would do in linux.
bin/myapp.exe
=> verylongpath/myapp/myapp.exe
. Ie using mklink bin/myapp.exe verylongpath/bin/myapp.exe
Now when i run the myapp, it's yelling against me that it can't find the dll. which means that the exe isn't run against its own working directory. Which makes me sad.
Is there somehow i can make it run in ints own working directory? Thanks!
windows symbolic-link mklink
Yes, Windows 7 supports NTFS symlinks in the form of the commandmlink
. Did you search? :) superuser.com/questions/234422/…
– Moses
Feb 22 '13 at 18:39
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I have a directory called apps/myapp/
with a file myapp.exe
which uses myapp.dll
and some other dlls.
Now lets say i want to symlink this to a directory, like one would do in linux.
bin/myapp.exe
=> verylongpath/myapp/myapp.exe
. Ie using mklink bin/myapp.exe verylongpath/bin/myapp.exe
Now when i run the myapp, it's yelling against me that it can't find the dll. which means that the exe isn't run against its own working directory. Which makes me sad.
Is there somehow i can make it run in ints own working directory? Thanks!
windows symbolic-link mklink
I have a directory called apps/myapp/
with a file myapp.exe
which uses myapp.dll
and some other dlls.
Now lets say i want to symlink this to a directory, like one would do in linux.
bin/myapp.exe
=> verylongpath/myapp/myapp.exe
. Ie using mklink bin/myapp.exe verylongpath/bin/myapp.exe
Now when i run the myapp, it's yelling against me that it can't find the dll. which means that the exe isn't run against its own working directory. Which makes me sad.
Is there somehow i can make it run in ints own working directory? Thanks!
windows symbolic-link mklink
windows symbolic-link mklink
edited Feb 22 '13 at 15:24
user1301428
1,94072752
1,94072752
asked Feb 22 '13 at 14:24
Emile
212
212
Yes, Windows 7 supports NTFS symlinks in the form of the commandmlink
. Did you search? :) superuser.com/questions/234422/…
– Moses
Feb 22 '13 at 18:39
add a comment |
Yes, Windows 7 supports NTFS symlinks in the form of the commandmlink
. Did you search? :) superuser.com/questions/234422/…
– Moses
Feb 22 '13 at 18:39
Yes, Windows 7 supports NTFS symlinks in the form of the command
mlink
. Did you search? :) superuser.com/questions/234422/…– Moses
Feb 22 '13 at 18:39
Yes, Windows 7 supports NTFS symlinks in the form of the command
mlink
. Did you search? :) superuser.com/questions/234422/…– Moses
Feb 22 '13 at 18:39
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
What you will likely need to do is symbolically link the folder containing your application binaries rather than just the EXE file itself. The most compatible way to make a directory symbolic link in Windows is use their junction points.
Use this command:
mklink /J ..linktargetdir linkdirname
Paths to the target can be relative to the current location. You don't need to start from the drive letter.
Once this is done you should be able to CD into your linkdirname and run your application as normal.
FYI: You could use the /D option for a directory symbolic link, but in my experience I've found junction points to behave in a much nicer (and more compatible) way. Some applications aren't fooled by directory symbolic links, but happily work with junctions. For example, in Steam, I can re-route game folders using junctions, but not with directory symbolic links.
add a comment |
up vote
0
down vote
You can create myapp.bat (instead of a link) and write below command into it:
call "absolutepathofyourexcecutable" %*
Example:
@call "C:Program Files (x86)GnuWin32binopenssl.exe" %*
Save above lines in openssl.bat everywhere you need a shortcut.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
What you will likely need to do is symbolically link the folder containing your application binaries rather than just the EXE file itself. The most compatible way to make a directory symbolic link in Windows is use their junction points.
Use this command:
mklink /J ..linktargetdir linkdirname
Paths to the target can be relative to the current location. You don't need to start from the drive letter.
Once this is done you should be able to CD into your linkdirname and run your application as normal.
FYI: You could use the /D option for a directory symbolic link, but in my experience I've found junction points to behave in a much nicer (and more compatible) way. Some applications aren't fooled by directory symbolic links, but happily work with junctions. For example, in Steam, I can re-route game folders using junctions, but not with directory symbolic links.
add a comment |
up vote
2
down vote
What you will likely need to do is symbolically link the folder containing your application binaries rather than just the EXE file itself. The most compatible way to make a directory symbolic link in Windows is use their junction points.
Use this command:
mklink /J ..linktargetdir linkdirname
Paths to the target can be relative to the current location. You don't need to start from the drive letter.
Once this is done you should be able to CD into your linkdirname and run your application as normal.
FYI: You could use the /D option for a directory symbolic link, but in my experience I've found junction points to behave in a much nicer (and more compatible) way. Some applications aren't fooled by directory symbolic links, but happily work with junctions. For example, in Steam, I can re-route game folders using junctions, but not with directory symbolic links.
add a comment |
up vote
2
down vote
up vote
2
down vote
What you will likely need to do is symbolically link the folder containing your application binaries rather than just the EXE file itself. The most compatible way to make a directory symbolic link in Windows is use their junction points.
Use this command:
mklink /J ..linktargetdir linkdirname
Paths to the target can be relative to the current location. You don't need to start from the drive letter.
Once this is done you should be able to CD into your linkdirname and run your application as normal.
FYI: You could use the /D option for a directory symbolic link, but in my experience I've found junction points to behave in a much nicer (and more compatible) way. Some applications aren't fooled by directory symbolic links, but happily work with junctions. For example, in Steam, I can re-route game folders using junctions, but not with directory symbolic links.
What you will likely need to do is symbolically link the folder containing your application binaries rather than just the EXE file itself. The most compatible way to make a directory symbolic link in Windows is use their junction points.
Use this command:
mklink /J ..linktargetdir linkdirname
Paths to the target can be relative to the current location. You don't need to start from the drive letter.
Once this is done you should be able to CD into your linkdirname and run your application as normal.
FYI: You could use the /D option for a directory symbolic link, but in my experience I've found junction points to behave in a much nicer (and more compatible) way. Some applications aren't fooled by directory symbolic links, but happily work with junctions. For example, in Steam, I can re-route game folders using junctions, but not with directory symbolic links.
answered Feb 22 '13 at 21:23
Adambean
7051717
7051717
add a comment |
add a comment |
up vote
0
down vote
You can create myapp.bat (instead of a link) and write below command into it:
call "absolutepathofyourexcecutable" %*
Example:
@call "C:Program Files (x86)GnuWin32binopenssl.exe" %*
Save above lines in openssl.bat everywhere you need a shortcut.
add a comment |
up vote
0
down vote
You can create myapp.bat (instead of a link) and write below command into it:
call "absolutepathofyourexcecutable" %*
Example:
@call "C:Program Files (x86)GnuWin32binopenssl.exe" %*
Save above lines in openssl.bat everywhere you need a shortcut.
add a comment |
up vote
0
down vote
up vote
0
down vote
You can create myapp.bat (instead of a link) and write below command into it:
call "absolutepathofyourexcecutable" %*
Example:
@call "C:Program Files (x86)GnuWin32binopenssl.exe" %*
Save above lines in openssl.bat everywhere you need a shortcut.
You can create myapp.bat (instead of a link) and write below command into it:
call "absolutepathofyourexcecutable" %*
Example:
@call "C:Program Files (x86)GnuWin32binopenssl.exe" %*
Save above lines in openssl.bat everywhere you need a shortcut.
edited Nov 25 at 7:32
answered Nov 21 at 19:28
Mir-Ismaili
1135
1135
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f555804%2fwindows-symlink-working-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Yes, Windows 7 supports NTFS symlinks in the form of the command
mlink
. Did you search? :) superuser.com/questions/234422/…– Moses
Feb 22 '13 at 18:39