This happens from CompB
So, from CompB, wordpad can't open a file from the command line.
Whereas from CompA, it opens
Both are running Windows 7
How can I make CompB, where wordpad doesn't open the file from the command line, like CompA that does?
Both of them if I do
where wordpad then both of them show
so it's not running a bat file..
Now I managed it for both. On the one where
C:\blah>wordpad a.a wasn't opening it, using the program files wordpad worked.
So of the two computers,
One where both wordpad locations work(CompA). One where only one wordpad locationworks(CompB, c:\program files..wordpad.exe).
The CompA c:\windows\system32\wordpad.exe is 214KB, and c:\program files...\wordpad.exe is 4MB.
The CompB, both locations wordpad.exe is 4MB
Looking at CompA if I copy c:\windows\system32\wordpad.exe to c:\program files...\wordpads.exe (wordpads.exe, the s for system32), then
"c:\program files\...\wordpads.exe" a.a works. So for CompA, it doesn't matter which wordpad file size is run, or what its filename is, or where it is run from. I can make a directory
c:\ggg copy wordpad to it, and make an a.a file, and run
.\wordpad.exe a.a and it works. Or I can copy the wordpad from "program files", to
c:\ggg and run
.\wordpad.exe a.a and that works. Both wordpad.exe files are different sizes but they each run from anywhere and with a parameter passed to them, and can be renamed too and still work.
CompB has the two wordpad files both 4MB and is fussy. It only runs wordpad.exe from program files. And even copying the program files wordpad, to wordpad.exe it won't run it. So the location has to be program files, and the filename has to be wordpad.exe
I wonder if maybe some time I ran "default programs editor" on CompA, but I just tried it on CompB and don't see anything there that would make a difference. I found a bat file on CompA funnily enough, called wordpad.bat that runs the program files wordpad.exe with
start "" "c:\Program Files\Windows NT\Accessories\wordpad.exe" %1 which I recall as being a solution to the problem at one time. So I must have had the issue at one time on CompA. But now CompA is fine. And it works without that bat file. (that bat file is not in my path). I wonder if maybe there's something in the registry of CompA that isn't for CompB. Though I don't know what. I tried looking at output from assoc and ftype commands though no difference there that I can see. CompA has been around for years, since I first tried Win7 and I notice that c:\windows\system32\wordpad.exe that's 200KB, is dated 2004 so may be I copied it from XP for whatever reason. But CompA has no issue with either wordpad.
I notice also that both comps have 2 in program files directories, one in
c:\program files x86, that is 4.2MB and one in
c:\program files that is 4.5MB
This from CompB
So wordpad from x86 worked.
But the second call to wordpad didn't work.
It's sensitive to the filename.
It's clearly not an issue with path variable but just to further show that it isn't. If you do
.\wordpad a.a that works, and then copy wordpad.exe wordpad_px86.exe and
.\wordpad_px86 a.a then same error.
C:\Program Files (x86)\Windows NT\Accessories>dir wordpad*.exe .. 28/08/2018 06:46 4,247,040 wordpad.exe 28/08/2018 06:46 4,247,040 wordpad_px86.exe .. C:\Program Files (x86)\Windows NT\Accessories>
It's filename sensitive.
But on CompA, it doesn't matter what I copy the binary as, it works opening the file passed as a parameter.