command-line

How to set environment variables with spaces?

狂风中的少年 提交于 2020-01-18 02:08:09
问题 I need to set values to a environmental variable using a batch file. I wrote the script for this: @echo off set value="Hello world" setx -M srijani "%srijani%;%value%" It gives the error: ERROR: Invalid syntax. Default option is not allowed more than '2' time(s). Type "SETX /?" for usage. I googled and found that while using white spaces we need to write it inside a double quotes. set value="Hello world" But, that is not working too. Note: I am on Windows 7. 回答1: The error output by command

Run bat file from java code to get desired result in txt file - no can do :(

青春壹個敷衍的年華 提交于 2020-01-17 07:41:29
问题 I have the following problem. I got a bat file that runs testcomplete test. After the test is finished in testcomplete, the app closes and exit code is passed back to the bat. Still in bat file i create a txt file called result and then depending on exit code i write to it successs, failure etc. When i run that bat file in Windows 7 i can see that test is being executed and after it's finished result.txt file appears with information i need. But when i simply run this same bat file from java

Creating Video and Streaming Command Line

社会主义新天地 提交于 2020-01-17 07:15:17
问题 Currently, using ffmpeg, I am using two commands on my Terminal to: 1) create a video from a bunch of images: ffmpeg -r 60 -f image2 -s 1920x1080 -i rotated-pano_frame%05d_color_corrected_gradblend.jpg -vcodec libx264 -crf 25 -pix_fmt yuv420p test.mp4 2) stream the video to a udp address: ffmpeg -re -i test.mp4 -c copy -f flv udp://127.0.0.1:48550 I am trying to combine both these instructions into one command line instruction, using &&, as suggested in the answer to a previous question of

How to subtract or add days or months to a date on Solaris?

落花浮王杯 提交于 2020-01-17 05:19:19
问题 Linux date has the -d feature which is missing in Solaris. So how can I go about subtracting or adding days or months to a date on Solaris. 回答1: you still can do this with perl or python oneliners, e.g., substract one day from current date: $ date Thu May 14 15:31:49 MEST 2015 $ python -c "from datetime import datetime, timedelta; print (datetime.now() - timedelta(1)).strftime('%c');" Wed May 13 15:31:58 2015 回答2: What you need is GNU date for Solaris. (Linux uses GNU tools) If you are using

Running windows command prompt commands in a Qt application

梦想的初衷 提交于 2020-01-17 04:34:04
问题 I need to run an external exe through Qt application which requires commands to be entered in windows command prompt. QString exePath = "C:\Windows\system32\cmd.exe"; QProcess pro; pro.start(exePath); pro.execute("cmd.exe"); But I got output like below plain cmd prompt But I want windows command prompt like expected cmd 回答1: You need to read from QProcess standart output and print it on screen. You can use pro.waitForReadyRead() and if it returns true do QByteArray arr = pro

Batch file with current date

别等时光非礼了梦想. 提交于 2020-01-17 00:07:29
问题 All, need a hlep in scripting in with batch file. I am very much new to scripting. I have an etl job which creates a file in a folder named as FINANCE20141011.txt. I need to create a batch file which will find current days file which is FINANCE20141011.txt (current date is 11/10/2014 and send the file to sftp server. There would be multiple file in the folder such as, FINANCE20141009.txt, FINANCE20141008.txt. But the script should pull up the current days file. Any help. Thanks. 回答1: @Echo

How to run TestNG suite from command line

自闭症网瘾萝莉.ら 提交于 2020-01-16 19:01:09
问题 I would like to run TestNG Suite from command line on Linux . I'm using eclipse to run test, but I have problem with command line. I know that I need to have testng.jar and I have it in /home/karcio/dev/testng-6.4.jar , location my suite xml is /home/karcio/git/java-test-automation/Automation/test-output/Default suite/TestSuite.xml . Commands what I tried, set classpath /home/karcio/dev/testng-6.4.jar cd /location to my suite xml file: java org.testing.TestNG TestSuite.xml This is error what

Advanced Command-Line Replace Command In VBScript

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-16 18:15:37
问题 I'm writing a compiler for my won computer language. Now before the language can be compiled i actually need to replace all apostrophes (') with percents (%) via a command-line vbs program. But the apostrophes only need to be replaced if there is NOT a circumflex accent (^) in front of it. So for example, in this code: color 0a input twelve = 0a "hi! that^'s great! " execute :testfornum 'twelve' exit :testfornum if numeric('1) ( return ) ELSE ( print 0a "oops 'twelve' should be numeric" )

Advanced Command-Line Replace Command In VBScript

时间秒杀一切 提交于 2020-01-16 18:12:05
问题 I'm writing a compiler for my won computer language. Now before the language can be compiled i actually need to replace all apostrophes (') with percents (%) via a command-line vbs program. But the apostrophes only need to be replaced if there is NOT a circumflex accent (^) in front of it. So for example, in this code: color 0a input twelve = 0a "hi! that^'s great! " execute :testfornum 'twelve' exit :testfornum if numeric('1) ( return ) ELSE ( print 0a "oops 'twelve' should be numeric" )

Detach own process from Windows Command Prompt

折月煮酒 提交于 2020-01-16 16:31:31
问题 I have a Windows command line process that currently performs a long I/O operation at the end (sending results to a server). Because I don't really have anything more to share with the user at that point*, I want to be able to give the user back their terminal before I begin the operation, while allowing the operation to finish in the background. How can I do this in my own application? My first idea is to put the non-blocking logic into a separate process, but I'd like to investigate keeping