Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
pulsar2121
- Posts: 6
- Joined: 08 Jan 2012 11:41
#1
Post
by pulsar2121 » 08 Jan 2012 11:48
I am trying to make universal shortcuts for my portable apps using batch files. This way I will not have to worry about the changing drive letters for different computers. I followed the tutorial here
http://itsallindexed.wordpress.com/2009 ... -shortcut/ It does not work for me. The program initializes in the taskbar, but then immediately terminates. Below is my code.
Code: Select all
"\BF2Portable\GameData\BattlefrontII.exe"
Please let me know if I have made any errors. Thanks.
-
pulsar2121
- Posts: 6
- Joined: 08 Jan 2012 11:41
#2
Post
by pulsar2121 » 08 Jan 2012 13:53
Update:
Tried this method with another application and it worked fine.
So, back to the old application--I went the properties of the executable and then the security tab(I'm using Vista) and checked the permissions. Everything was checked except full control and special permissions. So I checked fulled control, but wasn't able to check special permissions. I ran the batch file and the application opened for a second and then terminated just like before.
-
aGerman
- Expert
- Posts: 4738
- Joined: 22 Jan 2010 18:01
- Location: Germany
#3
Post
by aGerman » 08 Jan 2012 15:01
Keyword: "relative path"
Imagine your batch file is placed in batchfolder and you want to run application.exe
Absolute path:
"C:\subfolder1\batchfolder\subfolder2\application.exe"
Relative path with leading back space: The current drive letter is used.
"\subfolder1\batchfolder\subfolder2\application.exe"
Relative path without leading back space: The current path is used.
"subfolder2\application.exe"
Regards
aGerman
-
pulsar2121
- Posts: 6
- Joined: 08 Jan 2012 11:41
#4
Post
by pulsar2121 » 08 Jan 2012 17:51
I have the batch file in the relative directory, but it still doesn't work. I even put the absolute path in the batch file and the same thing still happens. It doesn't make any sense that it works if I make a shortcut in windows, but not when I make one in a batch file.
-
pulsar2121
- Posts: 6
- Joined: 08 Jan 2012 11:41
#5
Post
by pulsar2121 » 08 Jan 2012 19:31
I am having the same problem with another application. Here is my code.
Code: Select all
@echo off
"\TmNationsForever\TmForever.exe"
Not sure if these problems are related. Right now only 1 of the 3 apps have worked with this code.
-
alan_b
- Expert
- Posts: 357
- Joined: 04 Oct 2008 09:49
#6
Post
by alan_b » 09 Jan 2012 06:00
Are you sure your programs are intended to run under DOS ?
Nice friendly DOS appropriate *.EXE file respond to the /? argument with some help.
Some are not friendly.
Some may only run under Windows.
Online Games may refuse to allow cheating, and have strict control on how they are launched.
-
pulsar2121
- Posts: 6
- Joined: 08 Jan 2012 11:41
#7
Post
by pulsar2121 » 09 Jan 2012 22:21
Is there a way to make windows shortcuts with a relative path?
-
pulsar2121
- Posts: 6
- Joined: 08 Jan 2012 11:41
#8
Post
by pulsar2121 » 10 Jan 2012 07:20
Apparently not. I looked it up and .lnk shortcuts can only do direct paths. So is there a third party program I can download that will create shortcuts with a relative path that aren't DOS based?