I am a very old TC user (since it was Windows Commander, thus i still launch it via Ctrl+Alt+W combo because i get used to back in the day).
And I registered here for the first time because I got stuck with a strange behavior...
My .cmd batch file, and program that it starts, act differently when they are launched from Button bar and when launched directly by hitting Enter on it in a folder navigation window. When I launch it from button bar click i have an error, when i launch .cmd directly - it's ok. I've checked it several times after 2 reboots... Why? Are there any issues with running file different way?
I use Windows 7 and logged in with admin rights, TC ver. 8.52a (checked with 9.12 - same problem).
Please nudge me in a right direction)
p.s. this is unlikely due to a wrong startup folder, i change dir with cd command at the 1st line of my .cmd file: cd c:\my_path\...
Here is the content of start.cmd itself:
Very simple. 'npm start' launches Node.js server. The problem is that when i launch start.cmd from Button bar i get constant error output in browser. And there are no errors if i launch batch directly or via command prompt.
"Start" is internal command of cmd.exe. Reusing this name may be misleading. Rename your script to startnpm.cmd, startN.cmd or anything else. Just in case…
Use the /D switch to change current drive in addition to changing current directory for a drive. Suppose you want to click your button when browsing files on pendrive or DVD…
Code: Select all
cd /d c:\_WORK\edc_ui
Andrzej P. Wozniak
Please right click at the button in the button bar and chose COPY,...... paste that here in.
Also use Ctrl+C on the error dialog (or Ctrl-A + Ctrl-C on the error output in browser) and post that also here.
There is no problem in naming a batch START.cmd for to launch that batch (ok, may be depend on the used OS),
but not using well know names is definitive a good idea,
for example the need to use the internal command START in the directory with that batch in may not work as expected.
But probably you have space in your real path and you didn't use quotes there.
So please post your real command details and not modified examples only.
Also you can modify your start.cmd to:
Code: Select all
@ECHO OFF cd "c:\_WORK\edc_ui" npm start PAUSE
Ok, here it is:Please right click at the button in the button bar and chose COPY,...... paste that here in.
Code: Select all
TOTALCMD#BAR#DATA c:\_WORK\edc_ui\startNPM.cmd C:\Windows\System32\imageres.dll,-68 start c:\_WORK\edc_ui\ -1
Here is the script console output after running by hitting Enter on it in navigation window:
Here is the output after clicking on a Button bar:
They are the same (except the height of drive letter C: - don't know why).
But - the result is different! Running directly starts server normally:
Running via Button bar's shortcut:
In TC start a DOS console ( menu Commands > open command prompt)
and type SET + enter
or even SET nod + enter
Please note: different users (a elevated admin f.ex. is) have different environments. Just in case...
Are you sure you use the exact same batch file that's used in the button bar? Does it have the same working directory?
Working directory also the same, moreover i change it explicitly on the 1st line of script - just to be sure:
cd /d "c:\_WORK\edc_ui"
As for the Process Hacker I can't see anything unusual between two runs, except minor differences in memory consumption but this is expected - cause server refuses to work with client on one run and runs on another...
Stefan2, I already checked - environment is the same for both runs.
The ONLY visual difference in console output I got so far is "c:" and "C:" in path but this is ridiculous. Anyway - the server _launches_ both ways, so path hardly to be the reason. If i had, lets say, Cyrillic C instead of Latin - it wouldn't launch at all just at the start.
Did you check the process details by double-clicking on it? There you should take a look at the environment variables, the working (current) directory and elevation status (or user name).
If there's no difference, try the latest TC version (currently 9.22a) and/or TC 64-bit. If that doesn't change anything, I'm out of ideas.
If you want to change that try one or both of these INI-Parameters
From the Help > Configuration and Switches > Ini file Settings
Total Commander 7.50 Public Beta 2
26.04.09 Added: wincmd.ini [Configuration] DrivesShowUpcase=1
shows drives with uppercase drive letters in drive bar, drive dropdown list,
current dir, tabs and to the left of the command line
26.04.09 Added: wincmd.ini [Configuration] DrivesExportUpcase=1
exports paths with uppercase drive letters in functions like Mark - Copy to clipboard with full path,
and when launching programs (current dir, program name)
Note: The location of the ini files can be seen in menu Help - About Total Commander.
If entry doesn't exists, just create them below of [Configuration]
Find me: upper case drive letter C: .... lower case drive letter c: ...... ucase upcase drive