㈠ 怎样修改命令行参数
快捷方式单击右键进入属性框 即可在执行文件后面加上命令行参数
㈡ 如何在命令行脚本中启动带参数的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,或者“开始”菜单上右键,在弹出菜单上选择“命令行提示符”或“命令提示符(管理员)”,其中“命令提示符(管理员)”用于运行某些需要管理员权限的命令。