Shorcut Problem in batch file

  • Thread starter Thread starter Randy K.
  • Start date Start date
R

Randy K.

Platform: Win2k Pro

I have a couple of shortcuts on my local system that point to a .cmd file on
a network share. The .cmd's are used to copy some files and then run
another shortcut located on the local system. Here is an example:
----example---
copy \\networkshare\sourcefile.ini %windir%\destinationfile.ini
C:\localfolder\localprogram.lnk
----end example---
It used to be setup as the .cmd called the program that is referenced by the
2nd link, but that would leave a command window open while the program was
open. I came up with this solution several months ago and it works great on
my old system and all the other systems in my office. I just received a new
system and now when I run this shortcut, I get a
"C:\localfolder\localprogram.lnk is not a valid Win32 application" error and
the app never loads. I opened a command window and ran the .cmd directly to
see this error and the copy line runs without issue, just the .lnk reference
fails.

Any ideas why this new system would exhibit this issue and not any others
and how I can correct it?

TIA,
Randy K.
 
Can't you just recreate the shortcut?

Do other shortcuts to other applications work okay?

Ray at work
 
I have recreated it many times, same error. All shortcuts that point
directly to executables work fine, it is just when trying to 'run' a .lnk
file directly.
 
So, this happens with any .lnk file? It's not specific to this batch file?
Can you launch any programs from .lnk files? If you open a command prompt
and enter:

assoc .lnk

What is returned?

Ray at work
 
Correct, if I try and 'run' a .lnk file from the command line, then I get
that error. So, any batch file that tries to 'run' a .lnk file gets the
error as well.
 
Back
Top