![]() |
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-02 03:36 |
48,037 topics / 350,122 posts / today 2 new / 48,250 members |
| DOS批处理 & 脚本技术(批处理室) » Path expression! Consulted! |
| Printable Version 3,355 / 24 |
| Floor16 3742668 | Posted 2006-09-22 00:04 |
| 荣誉版主 Posts 718 Credits 2,013 | |
|
For the paths in the reg script, the usual correct writing format should be to write "\" as "\\".
For example: c:\windows\notepad.exe should be written as: c:\\windows\\notepad.exe In your script, you can use a method similar to the following: |
|
| Floor17 pengfei | Posted 2006-09-22 00:15 |
| 银牌会员 Posts 485 Credits 1,218 From 湖南.娄底 | |
|
The version 3742668 moderator is right. Some paths need to use double backslashes.
The code can be optimized as: "%systemdrive%\\Program Files\\internet explorer\\iexplore.exe" |
|
| Floor18 terse | Posted 2006-09-22 00:23 |
| 银牌会员 Posts 946 Credits 2,404 | |
Originally posted by 3742668 at 2006-9-22 00:04: The generated REG file still points to c:\ .... My original intention was not to have the drive letter, so that the REG file can be universal in XP and 2K! That is, how to set the default opening method of the iexplorer.exe in the program folder of the system drive as the specified program! |
|
| Floor19 3742668 | Posted 2006-09-22 00:48 |
| 荣誉版主 Posts 718 Credits 2,013 | |
The generated REG file still points to c:\.... My original intention is to not have the drive letter appear, so that the REG file can be universal in XP and 2K! That is, how to set the default open method of the specified program to iexplorer.exe in the program folder of the system drive! Don't be too impatient, take a closer look at the code of 16F set strPath=%programfiles:\=\\% Or for XP, directly use ftype, and for 2K, export the reg script. |
|
| Floor20 pengfei | Posted 2006-09-22 00:54 |
| 银牌会员 Posts 485 Credits 1,218 From 湖南.娄底 | |
|
I think I probably understand what the original poster means:
@echo off echo "%%systemdrive%%\\Program Files\\internet explorer\\iexplore.exe">open.reg If double backslashes don't work, please change them to single backslashes... [ Last edited by pengfei on 2006-9-22 at 00:55 ] |
|
| Floor21 terse | Posted 2006-09-22 04:26 |
| 银牌会员 Posts 946 Credits 2,404 | |
|
The people here are really very enthusiastic. First of all, thank you for the patient answers. Maybe I talked too much, and it might be clearer if I simplify it. That is, in the Folder Options, open File Types, I'll choose JPG files, click Advanced, and then you can see the default application for the execution operation. The path currently written is:
"C:\Program Files\Internet Explorer\IEXPLORE.EXE" %1, This corresponds to the second line in my INF registry file below, one sentence hkcr,".jpg",,,"jpgfile" hkcr,".jpg","PerceivedType",,"image" hkcr,".jpg","Content Type",,"image/jpg" hkcr,".jpg\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}",,,"{7376D660-C583-11d0-A3A5-00C04FD706EC}" hkcr,"jpgfile","EditFlags",0x10001,00,00,00,00 hkcr,"jpgfile","BrowserFlags",0x10001,08,00,00,00 hkcr,"jpgfile",,,"jpg image" hkcr,"jpgfile\CLSID",,,"{25336920-03F9-11cf-8FD0-00AA00686F13}" hkcr,"jpgfile\DefaultIcon",,,"F:\Program Files\Macromedia\Fireworks 8\Fireworks.exe,7" hkcr,"jpgfile\shell",,,"Internet Explorer" hkcr,"jpgfile\shell\Internet Explorer\command",,,"""C:\Program Files\Internet Explorer\IEXPLORE.EXE"" %%1" hkcr,"jpgfile\shell\用Fireworks编辑\command",,,"""F:\Program Files\Macromedia\Fireworks 8\Fireworks.exe"" %%1" Now the problem is that if the program folder on the system drive is not on drive C, this file will not work. Because I still have many backups of my INF file, so I think if I can solve the problem that the program folder on the system drive is not on drive C and it can still be used normally by importing this file, then it will be much more convenient for me in the future! Thank you all again! |
|
| Floor22 pengfei | Posted 2006-09-22 08:02 |
| 银牌会员 Posts 485 Credits 1,218 From 湖南.娄底 | |
|
hkcr,"jpgfile\shell\Internet Explorer\command",,,"""C:\Program Files\Internet Explorer\IEXPLORE.EXE"" %%1"
The LZ changed the above line to: hkcr,"jpgfile\shell\Internet Explorer\command",,,"""%systemdrive%\Program Files\Internet Explorer\IEXPLORE.EXE"" %%1" For whichever operating system you use, it is the IE browser program under that operating system. This line also performs the same modification: "C:\Program Files\Internet Explorer\IEXPLORE.EXE" %1, "%systemdrive%\Program Files\Internet Explorer\IEXPLORE.EXE" %1, If you want to use a batch file to generate registry information for import, the corresponding information is: echo "%%systemdrive%%\Program Files\Internet Explorer\IEXPLORE.EXE" %%1,>>open.reg |
|
| Floor23 terse | Posted 2006-09-22 09:53 |
| 银牌会员 Posts 946 Credits 2,404 | |
Originally posted by pengfei at 2006-9-22 08:02: After modification, there is such a prompt, and I uploaded the picture, |
|
| Floor24 pengfei | Posted 2006-09-22 10:23 |
| 银牌会员 Posts 485 Credits 1,218 From 湖南.娄底 | |
|
Does the INF file not support environment variables, but the registry can be used?
|
|
| Floor25 terse | Posted 2006-09-22 11:22 |
| 银牌会员 Posts 946 Credits 2,404 | |
Originally posted by pengfei at 2006-9-22 10:23: Tried, still no good. |
|
| Prev 1 2 |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |