标签: command

用于检查进程是否存在的批处理程序

我想要一个批处理程序,它将检查进程是否notepad.exe存在.

如果 notepad.exe存在,它将结束这个过程,

否则批处理程序将自行关闭.

这就是我所做的:

@echo off
tasklist /fi "imagename eq notepad.exe" > nul
if errorlevel 1 taskkill /f /im "notepad.exe"
exit
Run Code Online (Sandbox Code Playgroud)

但它不起作用.我的代码有什么问题?

windows command cmd batch-file

26
推荐指数
3
解决办法
11万
查看次数

Eclipse RCP:操作VS命令

Eclipse RCP上下文中的Actions和Commands之间有什么区别?我知道他们都对菜单条目有贡献,但哪一个更好?为什么?

在我阅读的所有在线资源中,我无法深入了解两者之间的差异.我实际上并没有尝试过使用它们,但只是想从更高层次的角度来理解它们.

谢谢

java eclipse rcp command action

25
推荐指数
2
解决办法
1万
查看次数

使用grep搜索find提供的文件:find有什么问题.| xargs grep'...'?

当我使用命令时:

find . | xargs grep '...'
Run Code Online (Sandbox Code Playgroud)

我得到了错误的比赛.我正在尝试...在当前文件夹中的所有文件中搜索字符串.

regex linux console command find

25
推荐指数
3
解决办法
8万
查看次数

如何使用xmlstarlet在另一个元素下插入新元素?

$ vim test.xml

<?xml version="1.0" encoding="UTF-8" ?>
<config>
</config>
$ xmlstarlet ed -i "/config" -t elem -n "sub" -v "" test.xml
<?xml version="1.0" encoding="UTF-8"?>
<sub></sub>
<config>
</config>
Run Code Online (Sandbox Code Playgroud)

但我希望sub成为配置的孩子.我该如何更改-ixpath参数

奖励:是否可以直接使用属性插入子项,甚至将其设置为值?就像是:

$ xmlstarlet ed -i "/config" -t elem -n "sub" -v ""  -a attr -n "class" -v "com.foo" test.xml
Run Code Online (Sandbox Code Playgroud)

xml xpath command-line command xmlstarlet

25
推荐指数
3
解决办法
2万
查看次数

用于ControlTemplate的ResourceDictionary中的WPF事件

我目前正在尝试实现Metro风格的窗口.
所以我在ResourceDictionary中创建了以下样式:

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<!-- Brushes -->
<SolidColorBrush x:Key="BackgroundColor" Color="#FFFFFFFF" />

<!-- Buttons -->
<Style x:Key="MetroControlBoxButton" TargetType="Button">
    <Setter Property="Background" Value="{StaticResource BackgroundColor}" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Button">
                <ContentPresenter />
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

<!-- Windows -->
<Style x:Key="MetroWindow" TargetType="Window">
    <Setter Property="UseLayoutRounding" Value="True" />
    <Setter Property="WindowStyle" Value="None" />
    <Setter Property="ResizeMode" Value="NoResize" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Window">
                <Grid Background="{StaticResource BackgroundColor}">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="6" />
                        <RowDefinition Height="24" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="24" />
                        <RowDefinition Height="6" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="6" …
Run Code Online (Sandbox Code Playgroud)

wpf events xaml command resourcedictionary

25
推荐指数
1
解决办法
1万
查看次数

无法使用curl命令下载github项目

我用"curl -sO"命令从这个GitHub项目链接下载项目文件:http://github.com/ziyaddin/xampp/archive/master.zip

但是,我无法下载.发生错误并说:

Archive:  /home/ziyaddin/Desktop/master.zip
[/home/ziyaddin/Desktop/master.zip]   End-of-central-directory
signature not found.  Either this file is not   a zipfile, or it
constitutes one disk of a multi-part archive.  In the   latter case
the central directory and zipfile comment will be found on   the last
disk(s) of this archive. zipinfo:  cannot find zipfile directory in
one of /home/ziyaddin/Desktop/master.zip or
          /home/ziyaddin/Desktop/master.zip.zip, and cannot find 
/home/ziyaddin/Desktop/master.zip.ZIP, period.
Run Code Online (Sandbox Code Playgroud)

但我可以用curl命令下载这个链接:http: //cloud.github.com/downloads/pivotal/jasmine/jasmine-standalone-1.3.1.zip

我认为这是因为它在cloud.github.com.我想知道如何从第一个链接下载curl命令?

bash curl command github download

25
推荐指数
3
解决办法
2万
查看次数

在bash中的文件末尾添加换行符

如何使用bash命令行在命名的文件末尾添加新行字符file.txt.我试过用echo但是不对.你能告诉我怎么做的吗?

bash command newline file

25
推荐指数
2
解决办法
4万
查看次数

以编程方式提出命令

我有一个按钮:

<Button x:Name="MyButton" Command="SomeCommand"/>
Run Code Online (Sandbox Code Playgroud)

有没有办法从源执行命令?调用按钮上的单击没有帮助:

MyButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
Run Code Online (Sandbox Code Playgroud)

我的意思是 - 这确实引发了事件,但它没有提高命令.有什么类似于此RaiseEvent但只是为了命令?如果没有 - 我怎样才能实例化ExecutedRoutedEventArgs?可能吗?

最后 - 请不要告诉我如何avoid调用命令.

wpf command

24
推荐指数
4
解决办法
3万
查看次数

Linux头/尾有偏移

在Linux中有没有办法要求Head或Tail但是要忽略记录的额外偏移量.

例如,如果文件example.lst包含以下内容:

row01
row02
row03
row04
row05
Run Code Online (Sandbox Code Playgroud)

我使用head -n3 example.lst我可以获得行1 - 3但是如果我想让它跳过第一行并得到行2 - 4怎么办?

我问,因为一些命令有一个标题,这在搜索结果中可能是不可取的.例如,du -h ~ --max-depth 1 | sort -rh将返回主目录中按降序排序的所有文件夹的目录大小,但会将当前目录追加到结果集的顶部(即~).

Head和Tail手册页似乎没有任何偏移参数,所以可能有某种range命令可以指定所需的行:例如range 2-10或者什么?

linux bash shell command-line command

24
推荐指数
2
解决办法
4万
查看次数

工匠显示插入"32m","34; 4m"和类似

我不知道为什么,但我的Git Bash终端显示34米和随机数字的地方.这是一个截图.在此输入图像描述

谢谢你的帮助.

bash terminal command line laravel

24
推荐指数
4
解决办法
8236
查看次数