shapeless Posted June 18, 2006 Share Posted June 18, 2006 (edited) I have a winrar SFX file that I want to prompt the user to install, but then after I want to run a batch file that creates a shortcut to a relevant EXE on their desktop, instead of having them fish for it. what is it that "right click, create shortcut" does exactly? when using shortcut.exe in my batch file, it wants a full path. I can't give it that, because I don't know what the user is going select for a directory. anyone know how to go about this?im wondering if there is some dos command that can give me an environment variable that contains the full path directory the batch file was called in? Edited June 18, 2006 by shapeless Link to comment Share on other sites More sharing options...
Andromeda43 Posted June 18, 2006 Share Posted June 18, 2006 Nope!There's a whole passle of things that batch files cain't do and that's one of 'em.You'll need something like a Visual Basic program that can ask you for keyboard entries.Good Luck, B) Link to comment Share on other sites More sharing options...
shapeless Posted June 18, 2006 Author Share Posted June 18, 2006 I got it to work!i also thought it was impossible until i found the environment variable I was looking for: %CD%heres my batch file to create a shortcut that will work with a user defined directory in a rar sfx:shortcut.exe /f:"%allusersprofile%\Desktop\Program.lnk" /a:c /t:"%CD%\Program_Subdir\App.exe" /w:"%CD%\Program_Subdir"so what happens is, the user specifies a directory for the program, lets say he uses C:\applicationafter it gets done unraring, the batch file runs which is located in the same directory as the exe i want the shortcut to. so then %CD% would equal whatever directory the user specifies, and a shortcut would be made. %CD% = current directory btw. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now