I want to use BAT to do file association, but there is a small problem, ask experts to help solve!
For example, I want to associate the .jsb file to be opened with Notepad. The following is the command, which can be realized under the DOS command prompt
Assoc .jsb=jsb
Ftype jsb=C:\WINDOWS\system32\notepad.exe %1
But I want to use BAT to realize batch processing to associate files. The following is the BAT script
@ECHO off
cls
color B
ECHO.
ECHO JSB file association
ECHO.
pause
Assoc .JSB=JSB
Ftype JSB=C:\WINDOWS\system32\notepad.exe %1
ECHO.
ECHO JSB file association succeeded
ECHO.
pause
exit
Problem, I use the same command, which can be realized under the command prompt, but cannot be realized in BAT. Why? Under the command prompt, I can define the variable of 1%, but in BAT, I cannot realize the variable of 1%, and after opening, it is empty! Please tell me how to solve it by experts. How should I write BAT? I think I have a wrong writing format.
[ Last edited by 2691614 on 2006-9-16 at 05:44 ]
For example, I want to associate the .jsb file to be opened with Notepad. The following is the command, which can be realized under the DOS command prompt
Assoc .jsb=jsb
Ftype jsb=C:\WINDOWS\system32\notepad.exe %1
But I want to use BAT to realize batch processing to associate files. The following is the BAT script
@ECHO off
cls
color B
ECHO.
ECHO JSB file association
ECHO.
pause
Assoc .JSB=JSB
Ftype JSB=C:\WINDOWS\system32\notepad.exe %1
ECHO.
ECHO JSB file association succeeded
ECHO.
pause
exit
Problem, I use the same command, which can be realized under the command prompt, but cannot be realized in BAT. Why? Under the command prompt, I can define the variable of 1%, but in BAT, I cannot realize the variable of 1%, and after opening, it is empty! Please tell me how to solve it by experts. How should I write BAT? I think I have a wrong writing format.
[ Last edited by 2691614 on 2006-9-16 at 05:44 ]
