3.3.0.2 x64 10/28/16
Windows 7 Ult.
I execute a .bat file in order to merge two .tgz files (updating hacked firmware file for my ereader).
From within X2 the cmd window returns "cannot find source file", (it's lying because I can see the fvcking thing).
From within windows explorer I execute the same .bat file and it finds the correct path, and .tgz file is updated.
(whilst it appears that I'm knowledgeable with merging .tgz files I have no idea what I'm doing, I just follow the point and click instructions for this hack which has worked find in the past from within X2).
I've also attached the .bat file as a text file. never mind I jpg'd the thing.
P.S. why are all the sentences underlined....?
Cmd path error below
executing .bat file doesn't find target. OK in Explorer
Moderators: fgagnon, nikos, Site Mods
-
dunno
- Gold Member

- Posts: 541
- Joined: 2007 Nov 18, 03:00
- Location: Tropical Hammock
-
Kilmatead
- Platinum Member

- Posts: 4879
- Joined: 2008 Sep 30, 06:52
- Location: Baile Átha Cliath
Re: executing .bat file doesn't find target. OK in Explorer
As the error seems to indicate that it's looking inside the x2 folder itself, that probably means the current-working-directory (which your script relies upon) is misplaced again. Try un-checking Tools -> Options -> Advanced (Tab) -> Don't lock browsed folder.
(Your post is underlined because when you quoted your x2 version you included the bracketed 'U' (for unicode), which the new forum software interprets as the beginning of an underlined senstence, and, of course, never finds the cancelling \U to kill it.)
The good news is that obviously humans have little to fear from the forum-AI being smarter than us anytime soon.
(Your post is underlined because when you quoted your x2 version you included the bracketed 'U' (for unicode), which the new forum software interprets as the beginning of an underlined senstence, and, of course, never finds the cancelling \U to kill it.)
-
dunno
- Gold Member

- Posts: 541
- Joined: 2007 Nov 18, 03:00
- Location: Tropical Hammock
Re: executing .bat file doesn't find target. OK in Explorer
Unchecking the "Don't Lock Folders" fixed it, (I'm trying to get my head around how "Uncheck a Don't lock" unlocks the thing).
silly me for not knowing the Unicode text paste stuff.
Cheers
silly me for not knowing the Unicode text paste stuff.
Cheers
-
johngalt
- Gold Member

- Posts: 654
- Joined: 2008 Feb 10, 19:41
- Location: 3rd Rock
Re: executing .bat file doesn't find target. OK in Explorer
I, too was experiencing a similar issue, also dealing with files to flash my Android-based Nexus 6.Kilmatead wrote: 2017 Feb 18, 07:38 As the error seems to indicate that it's looking inside the x2 folder itself, that probably means the current-working-directory (which your script relies upon) is misplaced again. Try un-checking Tools -> Options -> Advanced (Tab) -> Don't lock browsed folder.
(Your post is underlined because when you quoted your x2 version you included the bracketed 'U' (for unicode), which the new forum software interprets as the beginning of an underlined senstence, and, of course, never finds the cancelling \U to kill it.)The good news is that obviously humans have little to fear from the forum-AI being smarter than us anytime soon.
This also worked for me.
Just as a curiosity, why does not locking the folder cause this issue?
-
Kilmatead
- Platinum Member

- Posts: 4879
- Joined: 2008 Sep 30, 06:52
- Location: Baile Átha Cliath
Re: executing .bat file doesn't find target. OK in Explorer
It all rather depends upon what one's definition of what "locking" means, however the mechanics are these:johngalt wrote: 2017 Feb 28, 18:03Just as a curiosity, why does not locking the folder cause this issue?
If this option is un-checked, x2 sets the working-directory to whatever folder you happen to be browsing within at the time. Thus, when you click upon a batch file (or, really, any programme which assumes its own folder as the current-working folder) the new process inherits the default-folder, and assumes it as its own.
On the other hand, if this option is checked, then x2 sets the current-working-directory to the x2 install folder itself, thus messing up any relative-path references the batch-file presumes from its own location.
Now, obviously, your next question is going to be "Why use the x2 install folder, and what does this have to do with locking another folder in a galaxy far far away?"
The answer to that, I'm afraid, is above my pay-grade. I would surmise that as working-directories are stored as a global variable for each process which launches within it, if that folder/script/process goes awry and hangs for some reason, x2 may then be unable to delete/access the folder in question (on the level it needs to for shell-references to work properly), as it's considered to be held in purgatory by another process.
But to be honest, that's just a wild guess - and I suspect that the whole thing is really just a work-around to half-solve a conundrum wrapped up in an enigma of filesystem infidelity (that is to say, a shot in the dark to solve a problem which has no single cause).
-
dunno
- Gold Member

- Posts: 541
- Joined: 2007 Nov 18, 03:00
- Location: Tropical Hammock
Re: executing .bat file doesn't find target. OK in Explorer
Dear Sir who loves gardening and weeding code,
Why is a folder name which has & in it considered dangerous ?
I used to name folders "abc & def" until some dev pointed out that executing a .bat on that name could have disastrous consequences.
Why is a folder name which has & in it considered dangerous ?
I used to name folders "abc & def" until some dev pointed out that executing a .bat on that name could have disastrous consequences.
-
Kilmatead
- Platinum Member

- Posts: 4879
- Joined: 2008 Sep 30, 06:52
- Location: Baile Átha Cliath
Re: executing .bat file doesn't find target. OK in Explorer
Because the '&' character is considered a special character under the command shell, and so while it may be valid within a file/folder name, were you to reference that name/path within a batch file without "escaping" the ampersand first (by using the '^' prefix, etc) then cmd.exe will interpret it as a conditional statement, and your carefully crafted batch file will fold up and cry like the most bereft of souls.
So, this is not to say you can't use it in names, just that it requires more care and attention than a cantankerous lawn-mower engine which has been left in the damp too long. Does a busy hammock-dweller like yourself really need the hassle?
So, this is not to say you can't use it in names, just that it requires more care and attention than a cantankerous lawn-mower engine which has been left in the damp too long. Does a busy hammock-dweller like yourself really need the hassle?
-
dunno
- Gold Member

- Posts: 541
- Joined: 2007 Nov 18, 03:00
- Location: Tropical Hammock
Re: executing .bat file doesn't find target. OK in Explorer
I have this incredible knack of being able to break the most carefully crafted software....through sheer ignorance of code, you see I don't know what the do's and don'ts of this language are, hence the software developers in my old life hated me, as I could reduce their UI's to tears.Kilmatead wrote: 2017 Mar 01, 07:42Does a busy hammock-dweller like yourself really need the hassle?![]()
The above & issue scared the dev's of that .bat code to the extent that they included in the instructions, "ensure that you don't have any of the following etc" in the folder name. I was proud to have such a influence on the .bat file, whilst knowing that deep down they were shaking their heads in total disbelief that someone would dare/dumb to use a & in a folder name, how could I not know that I cannot use a certain special character which the file name monitor doesn't flag, in a file name ?, silly me.
I'm currently prodding Sony (PS4 UI) and Bethesda (Fallout 4 UI) to do something about their button selections, they're ignoring me now
My hammock is such a drag, I watched the fishermen this morning, extremely tiring, must retire.
-
nikos
- Site Admin

- Posts: 16402
- Joined: 2002 Feb 07, 15:57
- Location: UK
Re: executing .bat file doesn't find target. OK in Explorer
you can use any characters you like in your names and keep your BAT too. Either enclose arguments in "quotes" or use 8.3 names (lowercase $p etc tokens in xplorer2) that won't have anything funny in them
-
dunno
- Gold Member

- Posts: 541
- Joined: 2007 Nov 18, 03:00
- Location: Tropical Hammock
Re: executing .bat file doesn't find target. OK in Explorer
Nikos, you don;t understand, I know nothing of your language but I do expect coders to know that users might use characters in file names which might affect execution of the .bat file, as a user is it my responsibility to know what can and cant be done with instructions ?.nikos wrote: 2017 Mar 01, 09:22 Either enclose arguments in "quotes" or use 8.3 names (lowercase $p etc tokens in xplorer2) that won't have anything funny in them
I point and click, thats it, I read and do, if instructions say "click the .bat file" I'll do exactly that,
I'm still struggling to understand how uncheck a Don't Lock, unlocks the thing.
