![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-25 23:08 |
47,812 topics / 349,910 posts / today 0 new / 48,264 members |
| DOS批处理 & 脚本技术(批处理室) » [Discussion]Specialty of the explorer process |
| Printable Version 3,392 / 11 |
| Floor1 willsort | Posted 2006-06-20 10:25 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
To All:
The other day, I completed a batch processing code for processing a folder. There is a segment of code that intends to use the resource explorer to open the processed folder. After the user confirms that it is correct and closes the browser window of the folder, the subsequent processing operations are executed. The code is as follows: But the result is that start /w "did not play its due role", that is, after opening the test folder, it did not wait for it to close, and then output Program is finished. and return errorlevel: 0, and other subsequent operations are also executed in turn until the folder is deleted, and the browser window is automatically closed. Of course, here I don't advocate doubting whether there is any bug in start/w, but to think about whether there is any particularity of the explorer process of the resource explorer, which affects the performance of start/w. [ Last edited by willsort on 2006-6-20 at 11:17 ] |
|
| Floor2 bagpipe | Posted 2006-06-20 10:40 |
| 银牌会员 Posts 425 Credits 1,144 From 北京 | |
|
When executing a 32-bit GUI application, CMD.EXE returns to the command prompt before the application terminates. However, this new behavior does not occur when executing within a command script.
The above is written in the HELP for the START command............. |
|
| Floor3 bagpipe | Posted 2006-06-20 10:44 |
| 银牌会员 Posts 425 Credits 1,144 From 北京 | |
|
Oh, SORRY, wil said that I didn't test other programs just now. Indeed, other programs wait for their windows to continue execution, but EXPLORER.EXE is not like that, which needs to be considered........
|
|
| Floor4 bagpipe | Posted 2006-06-20 10:48 |
| 银牌会员 Posts 425 Credits 1,144 From 北京 | |
|
I think that the action of opening a directory with EXPLORER is such that once it's opened, the process ends and the program continues to execute. While for other programs like executing the SOL.EXE solitaire program, when started with START, it's in a suspended state and thus doesn't continue to execute. EXPLORER is just an execution action, and after this action ends, it will continue to execute the commands following the script. Opening the TEST directory is the final result.
|
|
| Floor5 willsort | Posted 2006-06-20 10:51 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
Re bagpipe (Post 2):
This information doesn't seem to explain anything. First, I did execute it in the command script, but this behavior still occurred; Second, for 32-bit GUI applications like notepad and calc, they are still affected by start/w, whether in the command line or in batch processing; Third, even in the script, if notepad or calc is not called with /w, it still returns before closing; however, whether the command prompt is returned depends on whether the script is run in the command line and whether it has completed running. Re bagpipe (Post 4): Brother mentioned "suspension", which reminds me that explorer, as the Windows shell, should generally not be suspended, otherwise desktop operations cannot be guaranteed. But our start test does not start a new explorer process, but only adds a test thread within the explorer process, which is quite different from 32-bit programs that create new processes and internal commands that do not create new processes and threads. So our starting point is still to find what is special about explorer, especially in terms of process or thread states. [ Last edited by willsort on 2006-6-20 at 11:01 ] |
|
| Floor6 namejm | Posted 2006-06-20 11:00 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
|
Please be careful, Willsort has compiled a piece of virus code: P
The situation is like this: After I copied this code down and put it in a separate batch file to run, hundreds of CMD windows popped up immediately, continuously prompting "The subdirectory or file test already exists", which made me flustered. It took me a long time to terminate the CMD process. Later, I added a pause after each execution statement to step through, and the captured screen is as follows. Later, I found that no matter whether start uses the parameter /w or not, this problem will occur, and after removing start /w, test will not be opened, while using the explorer test statement can open it smoothly. In this case, can we infer like this: In the default settings of CMD, folders are not associated with the file explorer, so we need to specify the way to open the folder? Attachments error.gif (23.68 KiB) |
|
| Floor7 willsort | Posted 2006-06-20 11:06 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
Re namejm:
It should be a problem of saving the code into test.cmd or test.bat. Brother, it seems that you have had the same name error before. The association between files, folders and corresponding programs has nothing to do with CMD, but in the corresponding key values of the registry. Because folders are not indirectly associated like .txt with extensions, so CMD cannot recognize them. [ Last edited by willsort on 2006-6-20 at 11:14 ] |
|
| Floor8 bagpipe | Posted 2006-06-20 11:10 |
| 银牌会员 Posts 425 Credits 1,144 From 北京 | |
|
I guess Brother namejm has a batch program like TEST.BAT or TEST.CMD in his directory, heh heh ...........
|
|
| Floor9 bagpipe | Posted 2006-06-20 11:14 |
| 银牌会员 Posts 425 Credits 1,144 From 北京 | |
|
EXPLORER Parameters TAG: Technical Article
You can use command-line parameters to customize the default view that Windows Explorer uses when it starts, as well as the view you see when you start it from the command prompt. You can use the following parameters with the Explorer.exe command. Parameter Result /n Opens a new single-pane window with the default selection. The default selection is usually the root directory of the drive on which Windows is installed. /e Starts Windows Explorer with the default view. /e, <object> Starts Windows Explorer with the default view and sets focus to the specified folder. /root, <object> Opens a window view of the specified object. /select, <object> Opens a window view with the specified folder, file, or program selected. Back to Top Run Windows Explorer from the Command Prompt To run Windows Explorer from the command prompt, do the following: 1. Click Start, and then click Run. 2. In the Open box, type Explorer, and then click OK. Examples The following examples illustrate the use of Windows Explorer parameters. ? Explorer /n This command opens an Explorer window with default settings. The contents are usually the root directory of the drive on which Windows is installed. ? Explorer /e This command starts Windows Explorer with the default view. ? Explorer /e,C:\Windows This command starts Windows Explorer with the default view and sets focus to C:\Windows. ? Explorer /root, C:\Windows\Cursors This command starts Windows Explorer and sets focus to the C:\Windows\Cursors folder. This example uses C:\Windows\Cursors as the "root" directory for Windows Explorer. Note: Notice the comma after the "/root" parameter in the command. ? Explorer /select, C:\Windows\Cursors\banana.ani This command starts Windows Explorer and selects the "C:\Windows\Cursors\banana.ani" file. Note: Notice the comma after the "/select" parameter in the command. Windows Explorer parameters can be combined in one command. The following example shows a combination of Windows Explorer command-line parameters. ? Explorer /root, \\server\share, select, Program.exe This command starts Windows Explorer with the remote share as the "root" folder, and the Program.exe file is selected. Back to Top Change the Default Start Folder for Windows Explorer To change the default start folder for Windows Explorer, do the following: 1. Click Start, point to All Programs, point to Accessories, and then right-click Windows Explorer. 2. On the menu that appears, click Properties. 3. In the Target box, append the "/root" command-line parameter to the "%SystemRoot%\Explorer.exe" command, using the start location you want. For example, if you want Windows Explorer to start focused on the root of drive C, edit the command to be: %SystemRoot%\Explorer.exe /root, C:\ I also take the opportunity to provide the parameters for EXPLORER, heh heh |
|
| Floor10 namejm | Posted 2006-06-20 11:20 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
|
Hehe, indeed I wrote the file name as test.bat, it's a habit issue, hey, please forgive me.
|
|
| Floor11 electronixtar | Posted 2006-06-21 14:12 |
| 铂金会员 Posts 2,672 Credits 7,493 | |
|
Because explorer is resident in memory ~~~ Before running the batch processing, first start ---> Shut down the computer, then Ctrl+Alt+Shift+click to cancel to close explorer
|
|
| Floor12 sohu | Posted 2010-12-04 15:36 |
| 新手上路 Posts 13 Credits 14 | |
|
have only a partial understanding
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |