command-prompt

Simple hibernate using command prompt

自古美人都是妖i 提交于 2019-12-25 02:15:44
问题 I have programmed a simple hibernate app which leaves me with errors. The following is my code. Contact.java public class Contact { private String firstName; private String lastName; private String email; private long id; public String getEmail() { return email; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public void setEmail(String string) { email = string; } public void setFirstName(String string) { firstName = string; } public void

How to sort the arguments dropped to a batch file?

你。 提交于 2019-12-24 23:56:42
问题 I am writing a batch file that finds and executes all update.bat file inside all the directories dropped onto it. The problem here is that I expect the arguments (i.e directories' path) comes in ordered by name but it turns out they are sorted by the modified date. Is this the default behavior of Windows (Windows 7)? Any suggestion to solve this? Here is my batch script: @echo off Setlocal EnableDelayedExpansion if [%1]==[] goto :no_update_dropped set LOG_FILE=update_log.txt echo You are

C# - LPR Command to Print PDF Files

我与影子孤独终老i 提交于 2019-12-24 11:05:51
问题 I am trying to run an LPR command to print a PDF. The code I'm using is being executed from a button click in a windows forms application. Code: var command = @"lpr –S 192.168.1.245 –P DAILY C:\Test.pdf"; ProcessStartInfo procStartInfo = new ProcessStartInfo("cmd", "/c " + command); procStartInfo.RedirectStandardOutput = true; procStartInfo.UseShellExecute = false; procStartInfo.RedirectStandardError = true; procStartInfo.CreateNoWindow = true; // start process Process proc = new Process();

VBScript's Shell Command Will Not Execute Unless An Output File Is Specified

吃可爱长大的小学妹 提交于 2019-12-24 10:24:51
问题 I'm trying to run a shell command for google speech recognition. I'm able to run the command only if I provide an output file to the command string. As you can see my test code sample below, I would attach the "> outputFile " if one is provided and also coded in a timeout loop to abort the process after a set time limit. strCommand = "cmd /c ipconfig /all" If outputFile <> "" Then strCommand = strCommand & " > """ & outputFile & """" End If Set wshShellExec = wshShell.Exec(strCommand)

How to search for line with ConstructionTime(10); in a file and get the number assigned to a variable?

痴心易碎 提交于 2019-12-24 08:58:29
问题 The command find /i "constructiontime" file.cfg outputs the line constructiontime(10); I want to read in this line and get just the number assigned to a variable independent on what is the number value. How can this be done? 回答1: The solution is using command FOR : @echo off set "ConstrutionTime=" for /F "tokens=2 delims=()" %%I in ('%SystemRoot%\System32\find.exe /I "constructiontime" file.cfg') do set "ConstrutionTime=%%I" if defined ConstrutionTime echo The construction time is:

Is there a way to run a .cmd file when a specific program is closed?

拥有回忆 提交于 2019-12-24 08:55:45
问题 I want the program GOPHER.exe to close when I close Netflix. I already have it set so that when I open Netflix, GOPHER also opens. Right now the command in the .cmd file to close GOPHER is "TASKKILL /IM gopher.exe". I want it to run when I close Netflix. 回答1: This monitors for programs exiting using WMI (MS's implementation of WBEM). Here it checks for Notepad exiting and restarts it. Set WshShell = WScript.CreateObject("WScript.Shell") Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")

Is there a way to run a .cmd file when a specific program is closed?

纵饮孤独 提交于 2019-12-24 08:52:59
问题 I want the program GOPHER.exe to close when I close Netflix. I already have it set so that when I open Netflix, GOPHER also opens. Right now the command in the .cmd file to close GOPHER is "TASKKILL /IM gopher.exe". I want it to run when I close Netflix. 回答1: This monitors for programs exiting using WMI (MS's implementation of WBEM). Here it checks for Notepad exiting and restarts it. Set WshShell = WScript.CreateObject("WScript.Shell") Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")

c#: transform a string targeted for the unix shell use for the windows command prompt

谁都会走 提交于 2019-12-24 08:22:45
问题 Here is a sample string I got off a socket stream. \033[H\033[J\033[1;30HSUPERVISOR MAIN MENU\033[6;5H 0. Exit Exit\033[7;5H 1. Help Display help\033[8;5H 2. Control Calling lists and users\033[9;5H 3. Campaign Campaigns\033[10;5H 4. Manage If you want to see the output I expect open a unix/linux shell, type echo -e followed by a space followed by the above string in single quotes and hit Enter key. The output appears something like: SUPERVISOR MAIN MENU 0. Exit Exit 1. Help Display help 2.

InstallScript can not read text file containing result from command prompt

余生长醉 提交于 2019-12-24 06:08:26
问题 I am writing a Installscript function to run a command in command prompt, redirect the result from console to a text file, then read the text file for information. // send command method STRING szCmdPath, szCmdLine ; szCmdPath = "C:\\WINDOWS\\system32\\cmd.exe"; szCmdLine = "/c wslconfig /l > D:\\output.txt"; LaunchAppAndWait(szCmdPath, szCmdLine, WAIT); the send command method did not run the command with szCmdLine as I desired, it failed to recognize the command and produce the following

InstallScript can not read text file containing result from command prompt

天涯浪子 提交于 2019-12-24 06:08:18
问题 I am writing a Installscript function to run a command in command prompt, redirect the result from console to a text file, then read the text file for information. // send command method STRING szCmdPath, szCmdLine ; szCmdPath = "C:\\WINDOWS\\system32\\cmd.exe"; szCmdLine = "/c wslconfig /l > D:\\output.txt"; LaunchAppAndWait(szCmdPath, szCmdLine, WAIT); the send command method did not run the command with szCmdLine as I desired, it failed to recognize the command and produce the following