ShellExecute failed. Code 2. Any ideas?

General MSTS related discussion that doesn't really fit into any of the other specific forums.

Moderator: Moderators

User avatar
delticcity
Well Established Forum Member
Posts: 946
Joined: Sat Oct 09, 2004 2:09 pm
Location: Vale of York near ECML

ShellExecute failed. Code 2. Any ideas?

Post by delticcity »

I have just tried to install the S&D dvd, and the DCv3 cd, on my computer this morning and both have resulted in this error. The batch files are not being allowed to install or run. Presumably this is a PC problem? I am running XP sp3 with 3Gb RAM and a 3 GHz processor. My anti-virus is up to date and I have just done a full scan with 0 infections found. Any ideas or help would be really appreciated. Dave.
User avatar
ashgray
Wafflus Maximus
Posts: 12235
Joined: Sun Jan 09, 2005 3:25 pm
Location: GWR, Nailsea, Somerset

Re: ShellExecute failed. Code 2. Any ideas?

Post by ashgray »

Hi

I'm not sure what the cause is buy if you type shellexecute failed:code 2 into Google's search engine and you'll find oads of pages with answers to this problem. :)

Ash
Ashley Gray

Intel Core i7-7700K @ 4.2Ghz Quad Core, Gigabyte Gaming Motherboard, 2 x 512Gb SSDs + 1TB SATA drives,
16 Gb DDR-4 Corsair RAM, Nvidia GeForce GTX1060 6Gb RAM, ASUS Xonar D2X/XDT Soundcard, Windows 10 64 bit
User avatar
delticcity
Well Established Forum Member
Posts: 946
Joined: Sat Oct 09, 2004 2:09 pm
Location: Vale of York near ECML

Re: ShellExecute failed. Code 2. Any ideas?

Post by delticcity »

Hi Ash, thanks for replying so quickly. I worked my way through most of the google threads this morning without finding anything trully helpful, there seem to be two trains of thought- either the exe files are somehow corrupted, or the registry has been attacked by a virus. Since so many people have recently installed the S&D dvd without problems I think I can safely discount that option, and I have completed my own deep scan plus a web-based deep scan without finding any nasties on my system. I'm at a loss what to try next. Dave.
User avatar
ashgray
Wafflus Maximus
Posts: 12235
Joined: Sun Jan 09, 2005 3:25 pm
Location: GWR, Nailsea, Somerset

Re: ShellExecute failed. Code 2. Any ideas?

Post by ashgray »

You could try copying the entire contents of the disks to a temporary folder on your hard drive and installing from there - then see if the batch file works.

Ash
Ashley Gray

Intel Core i7-7700K @ 4.2Ghz Quad Core, Gigabyte Gaming Motherboard, 2 x 512Gb SSDs + 1TB SATA drives,
16 Gb DDR-4 Corsair RAM, Nvidia GeForce GTX1060 6Gb RAM, ASUS Xonar D2X/XDT Soundcard, Windows 10 64 bit
User avatar
delticcity
Well Established Forum Member
Posts: 946
Joined: Sat Oct 09, 2004 2:09 pm
Location: Vale of York near ECML

Re: ShellExecute failed. Code 2. Any ideas?

Post by delticcity »

I've just noticed something else...........clicking on the installme.bat brings up " Cannot find...........................installme.bat" but this happens in ANY route. Odder and odder. Dave.
User avatar
delticcity
Well Established Forum Member
Posts: 946
Joined: Sat Oct 09, 2004 2:09 pm
Location: Vale of York near ECML

Re: ShellExecute failed. Code 2. Any ideas?

Post by delticcity »

I managed to install Dorset Coast onto the family PC and the batch file worked fine so I copied this bat file onto a memory stick and pasted into my Dorset folder on my PC to overwrite the original. Still no joy. Double clicking directly on the file brings up the "Cannot Find C:\Program Files\...........Dorset\Installme.bat" The same thing is happening with my S&D install. Suspicion seems to still lie with "ShellExecute failed. Code 2". Dave.

Incidentally Code 2 refers to a 'file not found' error.
User avatar
ashgray
Wafflus Maximus
Posts: 12235
Joined: Sun Jan 09, 2005 3:25 pm
Location: GWR, Nailsea, Somerset

Re: ShellExecute failed. Code 2. Any ideas?

Post by ashgray »

This may seem a daft question, but you DO have all six default routes installed on the PC you're trying to install S&D onto?

Ash
Ashley Gray

Intel Core i7-7700K @ 4.2Ghz Quad Core, Gigabyte Gaming Motherboard, 2 x 512Gb SSDs + 1TB SATA drives,
16 Gb DDR-4 Corsair RAM, Nvidia GeForce GTX1060 6Gb RAM, ASUS Xonar D2X/XDT Soundcard, Windows 10 64 bit
User avatar
delticcity
Well Established Forum Member
Posts: 946
Joined: Sat Oct 09, 2004 2:09 pm
Location: Vale of York near ECML

Re: ShellExecute failed. Code 2. Any ideas?

Post by delticcity »

Yes I've got all 6 default routes Ash. None of the batch files in the different routes my Routes folder seem to be visible to the system. Clicking directly on each brings up the 'can't find' message. I suspect maybe a registry issue but don't know enough about it to have a tinker. Dave.
slipperman12
Very Active Forum Member
Posts: 6067
Joined: Mon Nov 12, 2007 9:50 am
Location: North Nottinghamshire, UK

Re: ShellExecute failed. Code 2. Any ideas?

Post by slipperman12 »

Hi,
Looking at the Google results, I've got two ideas - but, of course, you may have already tried them :)

Can you run the installme.bat using the Run as Administrator option? (applies to any other file also)

Do you have NotePad++ installed? If so, disable the 'Run as Administrator' option for it.

And a third point - if you are using Vista or Windows 7, check the settings for UAC.

Cheers,
Ged
Intel i5-4690K (3.5Ghz), Gigabyte GA-Z97P-D3 m/b, 12GB DDR3 RAM, NVIDIA GTX 750ti (2GB) graphics card, Asus Xonar DS sound card. Win 10 Pro 64-bit.
User avatar
delticcity
Well Established Forum Member
Posts: 946
Joined: Sat Oct 09, 2004 2:09 pm
Location: Vale of York near ECML

Re: ShellExecute failed. Code 2. Any ideas?

Post by delticcity »

Hi Ged, I am running as administrator already, and I'm using XP sp3. I don't quite follow what you mean about notepad. I have got it on my system. Dave.
slipperman12
Very Active Forum Member
Posts: 6067
Joined: Mon Nov 12, 2007 9:50 am
Location: North Nottinghamshire, UK

Re: ShellExecute failed. Code 2. Any ideas?

Post by slipperman12 »

Hi Dave,
No, the software I referred to is NotePad++ - it's not the built in NotePad!

I've found out that XP doesn't have UAC, but something called Microsoft Data Access Component (MDAC) which performs a similar function. It would really need someone who knows XP to advise you on checking this.

As you are reading this, I assume that you are able to run exe files - please confirm. If so, is it only bat files which won't run?

Have you, or anyone else using your PC, downloaded ANYTHING recently, ie before you started having this problem?

Cheers,
Ged
Intel i5-4690K (3.5Ghz), Gigabyte GA-Z97P-D3 m/b, 12GB DDR3 RAM, NVIDIA GTX 750ti (2GB) graphics card, Asus Xonar DS sound card. Win 10 Pro 64-bit.
User avatar
delticcity
Well Established Forum Member
Posts: 946
Joined: Sat Oct 09, 2004 2:09 pm
Location: Vale of York near ECML

Re: ShellExecute failed. Code 2. Any ideas?

Post by delticcity »

Hi Ged, no I don't have NotePad++. I am the only person to ever use this pc and I haven't downloaded anything recently that I would suspect. I'm not too computer literate so aren't sure about running other exe files. Certainly none of my Bat files within msts work. I can run other programs and applications ok but I don't know which of these employ exe files?
slipperman12
Very Active Forum Member
Posts: 6067
Joined: Mon Nov 12, 2007 9:50 am
Location: North Nottinghamshire, UK

Re: ShellExecute failed. Code 2. Any ideas?

Post by slipperman12 »

Hi Dave,
Most programs are exe files - for example, train.exe. Does MSTS run OK from its icon on the Desktop?

Cheers,
Ged
Intel i5-4690K (3.5Ghz), Gigabyte GA-Z97P-D3 m/b, 12GB DDR3 RAM, NVIDIA GTX 750ti (2GB) graphics card, Asus Xonar DS sound card. Win 10 Pro 64-bit.
User avatar
delticcity
Well Established Forum Member
Posts: 946
Joined: Sat Oct 09, 2004 2:09 pm
Location: Vale of York near ECML

Re: ShellExecute failed. Code 2. Any ideas?

Post by delticcity »

Yes everything else works fine - msts, trainstore, flight sim, hellfire etc. It just seems like Batch files 'cannot be found'. Dave.
slipperman12
Very Active Forum Member
Posts: 6067
Joined: Mon Nov 12, 2007 9:50 am
Location: North Nottinghamshire, UK

Re: ShellExecute failed. Code 2. Any ideas?

Post by slipperman12 »

Hi Dave,
Well, that's good then!
As I don't have XP, I am going from what i found under Google!

Go into Control Panel
Select Folder Options
Click on File Type tab
You should have a window listing the file types that XP recognises.
Look in this list for BAT
If it's there, what does it say under 'Details'? Don't do any more, but come back.
If it's not there, click on the 'New' button
Type BAT into the File Extension box
Click OK
I'm working blind here, but if there is a 'Restore' option, click on it.
Close all the dialog boxes

Let me know how you do, please!

Cheers,
Ged
Intel i5-4690K (3.5Ghz), Gigabyte GA-Z97P-D3 m/b, 12GB DDR3 RAM, NVIDIA GTX 750ti (2GB) graphics card, Asus Xonar DS sound card. Win 10 Pro 64-bit.
Locked

Return to “[MSTS1] General MSTS Discussion”