㈠ 怎樣修改命令行參數
快捷方式單擊右鍵進入屬性框 即可在執行文件後面加上命令行參數
㈡ 如何在命令行腳本中啟動帶參數的Windows服務
才看明白,你說是要啟動的服務指向文件或腳本本身需要參數。 如果是那樣,你沒辦法直接辦到。因為windows的服務程序,它的具體指向都在注冊表的相應的ImagePath中,比如:Browser這個服務,在注冊表中:1
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Browser
它的啟動項:
1
ImagePath = %SystemRoot%\System32\svchost.exe -k netsvcs
參數是寫在裡面的,和普通程序的運行不一樣,你只須:
1
2
3
net start Browser
或
sc start Browser
即可。
唯一能作的,先停了該服務,然後修改它的imagepath,然後在啟動,在批處理中,大致如下:
1
2
3
sc stop mysrv 1>nul 2>&1
sc config mysrv binPath= "c:\some path with space\abc.demo.exe" "parm1" "parm2"
sc start mysrv 1>nul 2>&1
㈢ 如何修改這裡面的參數,命令是啥windows的cmd
cmd是windows下的命令行窗口。
(1)可以讓你像在dos下一樣通過輸入命令來進行一些操作。
(2)在XP系統下,點擊「開始」,「運行」,輸入「cmd」,回車,即可打開命令行窗口,進行相應操作。windows 7系統下在開始-- 搜索框里輸入cmd搜索即可找到cmd.exe程序,運行即可。
(3)該窗口命令均為輸入命令,如果不知道命令,鍵入「help」,回車,窗口內就會顯示其基本命令及用法,方便你使用。需要說明的是:許多高級命令口令,無法用這個方法顯示。
(4)如「systeminfo」這一命令,能夠調用系統信息(何時安裝的系統、cpu型號、安裝補丁數量、筆記本電腦類型、網卡型號、電腦已運行時間等等),就無法顯示。因為它是高級命令。
CMD又叫做命令提示符,在操作系統中提示進行命令輸入的一種工作提示符。在不同的操作系統環境下,命令提示符各不相同。
在windows環境下,命令行程序為cmd.exe,是一個32位的命令行程序,微軟Windows系統基於Windows上的命令解釋程序,類似於微軟的DOS操作系統。輸入一些命令,cmd.exe可以執行,比如輸入shutdown -s就會在30秒後關機。
㈣ Fortran命令行啟動怎麼往主程序輸入參數
主要使用下面的三個函數實現:
第一個:
COMMAND_ARGUMENT_COUNT — Get number of command line arguments
Description:
COMMAND_ARGUMENT_COUNT returns the number of arguments passed on the command line when the containing program was invoked.
Standard:
Fortran 2003 and later
Class:
Inquiry function
Syntax:
RESULT = COMMAND_ARGUMENT_COUNT()
Arguments:
None
Return value:
The return value is an INTEGER of default kind.
Example:
program test_command_argument_count
integer :: count
count = command_argument_count()
print *, count
end program test_command_argument_count
COMMAND_ARGUMENT_COUNT — Get number of command line arguments
Description:
COMMAND_ARGUMENT_COUNT returns the number of arguments passed on the command line when the containing program was invoked.
Standard:
Fortran 2003 and later
Class:
Inquiry function
Syntax:
RESULT = COMMAND_ARGUMENT_COUNT()
Arguments:
None
Return value:
The return value is an INTEGER of default kind.
Example:
program test_command_argument_count
integer :: count
count = command_argument_count()
print *, count
end program test_command_argument_count
第二個:
GET_COMMAND_ARGUMENT — Get command line arguments
Description:
Retrieve the NUMBER-th argument that was passed on the command line when the containing program was invoked.
Standard:
Fortran 2003 and later
Class:
Subroutine
Syntax:
CALL GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS])
Arguments:
NUMBER Shall be a scalar of type INTEGER and of default kind, NUMBER \geq 0
VALUE (Optional) Shall be a scalar of type CHARACTER and of default kind.
LENGTH (Optional) Shall be a scalar of type INTEGER and of default kind.
STATUS (Optional) Shall be a scalar of type INTEGER and of default kind.
Return value:
After GET_COMMAND_ARGUMENT returns, the VALUE argument holds the
NUMBER-th command line argument. If VALUE can not hold the argument, it
is truncated to fit the length of VALUE. If there are less than NUMBER
arguments specified at the command line, VALUE will be filled with
blanks. If NUMBER = 0, VALUE is set to the name of the program (on
systems that support this feature). The LENGTH argument contains the
length of the NUMBER-th command line argument. If the argument retrieval
fails, STATUS is a positive number; if VALUE contains a truncated
command line argument, STATUS is -1; and otherwise the STATUS is zero.
Example:
PROGRAM test_get_command_argument
INTEGER :: i
CHARACTER(len=32) :: arg
i = 0
DO
CALL get_command_argument(i, arg)
IF (LEN_TRIM(arg) == 0) EXIT
WRITE (*,*) TRIM(arg)
i = i+1
END DO
END PROGRAM
GET_COMMAND_ARGUMENT — Get command line arguments
Description:
Retrieve the NUMBER-th argument that was passed on the command line when the containing program was invoked.
Standard:
Fortran 2003 and later
Class:
Subroutine
Syntax:
CALL GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS])
Arguments:
NUMBER Shall be a scalar of type INTEGER and of default kind, NUMBER \geq 0
VALUE (Optional) Shall be a scalar of type CHARACTER and of default kind.
LENGTH (Optional) Shall be a scalar of type INTEGER and of default kind.
STATUS (Optional) Shall be a scalar of type INTEGER and of default kind.
Return value:
After GET_COMMAND_ARGUMENT returns, the VALUE argument holds the
NUMBER-th command line argument. If VALUE can not hold the argument, it
is truncated to fit the length of VALUE. If there are less than NUMBER
arguments specified at the command line, VALUE will be filled with
blanks. If NUMBER = 0, VALUE is set to the name of the program (on
systems that support this feature). The LENGTH argument contains the
length of the NUMBER-th command line argument. If the argument retrieval
fails, STATUS is a positive number; if VALUE contains a truncated
command line argument, STATUS is -1; and otherwise the STATUS is zero.
Example:
PROGRAM test_get_command_argument
INTEGER :: i
CHARACTER(len=32) :: arg
i = 0
DO
CALL get_command_argument(i, arg)
IF (LEN_TRIM(arg) == 0) EXIT
WRITE (*,*) TRIM(arg)
i = i+1
END DO
END PROGRAM
第三個:
GET_COMMAND — Get the entire command line
Description:
Retrieve the entire command line that was used to invoke the program.
Standard:
Fortran 2003 and later
Class:
Subroutine
Syntax:
CALL GET_COMMAND([COMMAND, LENGTH, STATUS])
Arguments:
COMMAND (Optional) shall be of type CHARACTER and of default kind.
LENGTH (Optional) Shall be of type INTEGER and of default kind.
STATUS (Optional) Shall be of type INTEGER and of default kind.
Return value:
If COMMAND is present, stores the entire command line that was used to
invoke the program in COMMAND. If LENGTH is present, it is assigned the
length of the command line. If STATUS is present, it is assigned 0 upon
success of the command, -1 if COMMAND is too short to store the command
line, or a positive value in case of an error.
Example:
PROGRAM test_get_command
CHARACTER(len=255) :: cmd
CALL get_command(cmd)
WRITE (*,*) TRIM(cmd)
END PROGRAM
GET_COMMAND — Get the entire command line
Description:
Retrieve the entire command line that was used to invoke the program.
Standard:
Fortran 2003 and later
Class:
Subroutine
Syntax:
CALL GET_COMMAND([COMMAND, LENGTH, STATUS])
Arguments:
COMMAND (Optional) shall be of type CHARACTER and of default kind.
LENGTH (Optional) Shall be of type INTEGER and of default kind.
STATUS (Optional) Shall be of type INTEGER and of default kind.
Return value:
If COMMAND is present, stores the entire command line that was used to
invoke the program in COMMAND. If LENGTH is present, it is assigned the
length of the command line. If STATUS is present, it is assigned 0 upon
success of the command, -1 if COMMAND is too short to store the command
line, or a positive value in case of an error.
Example:
PROGRAM test_get_command
CHARACTER(len=255) :: cmd
CALL get_command(cmd)
WRITE (*,*) TRIM(cmd)
END PROGRAM
最近在Fortran的數據傳遞設計上碰到了問題。現在略歸納下子程序間參數傳遞的實現辦法。
首先,Fortran subroutine
獨立地擁有屬於自己的變數申明。有說:Fortran的變數作用域只有兩類:一是全局作用域,二是子程序作用域,並且子程序內部不存在嵌套作用域。最後一
點很重要喲。舉例:在一個子程序里申明的變數,不能在與之並列的另外一個子程序裡面使用。即兩個子程序不能有變數重疊。即使在這個兩個子程序里都使用了同
名的某個變數,本質上講,在這兩個子程序里的同名變數也是沒任何聯系的。
那麼,如果需要在子程序之間傳遞變數(參數),怎麼辦呢?還要細說一點:傳參的結構有兩類:第一類,諸如主程序-子程序、外層子程序-內層子程序(子程序嵌套)之間的參數傳遞,另外一類,就是並列的兩個子程序(即它們之間不需要有關系,僅僅由於需求相同的變數)之間的參數傳遞。
第一類傳參結構的實現常見傳址調用。
第二類傳參結構的實現常見申明公共內存塊,將需求的相同變數申明成全局變數,那麼各個子程序自然都可以用了。注意,仍然是地址,所以子程序可以修改這些全局變數的。
其中,FORTRAN77的公共塊(全局變數申明)使用COMMON;FORTRAN90以後使用MODULE來包裝公共塊。
來看幾個問題:
一、以數組A中滿足某一條件的元素的編號構成新的數組B
do bi=1,bn
do ai=1,an
if(A(ai).eq.a0) then
B(bi)=ai
endif
enddo
enddo
二、以數組A的元素為編號,取數組B的元素進行其他運算
do bi=1,bn
do ai=1,an
if (bi.eq.A(ai)) then
fun(i)=fun(i)+fun2(bi)
endif
enddo
enddo
㈤ SpringBoot修改JVM參數(內置Tomcat命令行啟動和IDEA工具配置修改)
在 「-jar」 之前加上相應參數即可
-Xms:初始堆的分配大小,默認為物理內存的六十四分之一(Server端JVM最好將-Xms和-Xmx設為相同值);
-Xmx:堆的最大分配大小(默認為物理內存的四分之一);
-Xmn Java Heap Young區大小,不熟悉最好保留默認值;
-Xss 每個線程的Stack大小,不熟悉最好保留默認值;
-XX:+UseG1GC:用這個GC;
-XX:+PrintGCDetails:列印信息;
修改相應的 VM options參數即可
復制粘貼到txt文件中,之後,記得改後綴名為「.bat」
TITLE 數據上報 8090
"C:\Users\guany\Desktop\開發\JDK8\bin\java.exe" -Xms512m -Xmx512m -XX:+UseG1GC -XX:+PrintGCDetails -jar pt_dataPush_api-1.0.0.jar
pause
1
㈥ Windows如何在cmd命令行中查看、修改、刪除與添加、設置環境變數
1)查看:
SET --會列出所有環境變數及其值;
SET XX--僅查看XX變數及其值;
2)修改:
SET XX=xxx --把XX變數的值改為xxx;
SET XX=%XX%yy --這是另一種便捷修改方式,把XX變數的值改為『在原值後面追加yy』。比如對於path變數,它原來的值很長,通常我們修改它的值的時候是在它原值的基礎上增加一個字元串,那麼這種方式比較方便,而不需要先拷貝原值再修改。
3)刪除:
SET XX= --即賦予空值,就把XX變數刪掉了。
4)添加:
SET XX=xxx --其實同修改是一樣的,沒有XX變數的話就新增了XX變數,有的話就修改XX的值。
如上,就是windows下對於環境變數的設置(增刪改查)操作。
㈦ cmd命令行啟動應用,但是如何加參數,達到win10里兼容xp這個效果
1
方法1:
同時按下win+R,在打開的運行對話框中輸入:cmd後,回車打開。
2
方法2:
也可以在同時按下win+x,或者「開始」菜單上右鍵,在彈出菜單上選擇「命令行提示符」或「命令提示符(管理員)」,其中「命令提示符(管理員)」用於運行某些需要管理員許可權的命令。