command

execute file .lnk in Java

…衆ロ難τιáo~ 提交于 2019-12-06 14:19:44
问题 i need to execute a .lnk file in java (lnk file that points at an exe file). how can i do? in vb .net i do Process.Start(path) and it works thx you for help. 回答1: Use a ProcessBuilder: ProcessBuilder pb = new ProcessBuilder("cmd", "/c", "C:\\temp\\file.lnk"); Process process = pb.start(); Call process.getInputStream() and process.getErrorStream() to read the output and error output of the process. 回答2: On Windows, you could use rundll : Runtime.getRuntime().exec("rundll32 SHELL32.DLL

List duplicate files in a directory in Unix

∥☆過路亽.° 提交于 2019-12-06 14:11:18
Is there any unix commands that can display duplicate files in a particular directory .kindly let me know your comments. You should be able to use fdupes to achieve this. fdupes ./directory That should list all the duplicate files in a directory, you can also pass it -r for a recursive scan into subdirectories. 来源: https://stackoverflow.com/questions/5321509/list-duplicate-files-in-a-directory-in-unix

What is a equivalent of Delphi “shl” in C#?

半城伤御伤魂 提交于 2019-12-06 11:58:42
I'm making an application in C#, based on Delphi (converting code), but I found a command that I do not recognize (shl), and i want to know if there is any equivalent to C#. Thanks in advance. Shl is left shift . Use << C# operator for the same effect. Example: uint value = 15; // 00001111 uint doubled = value << 1; // Result = 00011110 = 30 uint shiftFour = value << 4; // Result = 11110000 = 240 From Shl Keyword this is a bitwise shift left which from C# Bitwise Shift Operators would be << Shl is the shift left operator, in C# you use << . var a : Word; begin a := $2F; // $2F = 47 decimal a :

How to run rename shell command in android app (rooted)

不问归期 提交于 2019-12-06 11:43:49
问题 I'm new to Android. I'm trying to run a shell command to rename a file in the system. I've got root access to it. The shell command: $ su # mount -o remount,rw /system # mv system/file.old system/file.new I have tried this but doesn't work: public void but1(View view) throws IOException{ Process process = Runtime.getRuntime().exec("su"); process = Runtime.getRuntime().exec("mount -o remount,rw /system"); process = Runtime.getRuntime().exec("mv /system/file.old system/file.new"); } 回答1: You

Problem with starting OpenOffice service (soffice) from Java (command working in commandline, but not from Java)

泪湿孤枕 提交于 2019-12-06 11:04:49
问题 I want to exceute a simple command which works from the shell but doesn't work from Java. This is the command I want to execute, which works fine: soffice -headless "-accept=socket,host=localhost,port=8100;urp;" This is the code I am excecuting from Java trying to run this command: String[] commands = new String[] {"soffice","-headless","\"-accept=socket,host=localhost,port=8100;urp;\""}; Process process = Runtime.getRuntime().exec(commands) int code = process.waitFor(); if(code == 0) System

Excel 2007 Issue: Pre-programmed Buttons suddenly not working [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-06 10:24:59
This question already has answers here : Microsoft Excel ActiveX Controls Disabled? (11 answers) Closed 4 years ago . Today, out of the blue, a form that the company I work for uses, suddenly had an issue with it's buttons. Strangely enough it only is affecting what I'm pretty sure are the ActiveX Command Buttons and not causing a problem with the other shapes or drop downs. The issue. The buttons are non-responsive. When you click, they don't access the code and checking them via the shapes menu and selecting "view code" causes them to open the developer menu, but not the code associated with

C program to perform a pipe on three commands

…衆ロ難τιáo~ 提交于 2019-12-06 09:47:44
I have to write a program that will perform the same operation that du | sort | head in the command line would do, but I'm stuck, and my program is not working. The output right now is 112 . and the program doesn't terminate. Please help, I don't know what to do! int main(void) { int fd[2]; int fd1[2]; int pid; if (pipe(fd) == -1) { perror("Pipe"); exit(1); } switch (fork()) { case -1: perror("Fork"); exit(2); case 0: dup2(fd[1], STDOUT_FILENO); close(fd[0]); close(fd[1]); execl("/usr/bin/du", "du", (char *) 0); exit(3); } if (pipe(fd1) == -1) { perror("Pipe"); exit(1); } switch (fork()) {

run Java program with jar from Python

空扰寡人 提交于 2019-12-06 09:38:26
问题 I am trying to run a java file with a jar from Python. I first run the command : java -classpath ".:/Users/blablalba/jackson-all-1.9.0.jar" parseJason it worked perfectly. Then I wrote a small python script to execute the java file. (Updated: I made a change based on the suggestion below. import os.path,subprocess from subprocess import STDOUT,PIPE def compile_java(java_file): subprocess.check_call(['javac', java_file]) def execute_java(java_file, stdin): java_class,ext = os.path.splitext

A batch file that copies another into Start Up folder?

蓝咒 提交于 2019-12-06 09:17:00
I am making a batch file that needs to copy another batch file into the Start Menu Start Up folder (the one used when a program launches on login/start up) . Since the path uses the user's computer name eg. C:\Documents and Settings\User Name I need the batch file to get the user's correct name instead of the "User Name" or * (wildcard). Wildcards doesn't work as the batch file comes up with " the filename directory name or volume label syntax is incorrect ". I hope this is clear enough. zask You can also try this: cd %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup It works in Windows

How should I implement the OSGi console into a Bundle?

强颜欢笑 提交于 2019-12-06 09:14:59
I'm new on OSGi and I'm trying to implement the osgi console into a bundle. I need to manage the other bundles/services from my bundle. So I need to be able to use the "ss", "install" and "unistall" commands at least on other services already installed or not. All this commands must be managed without human interaction, so I must to implement this into my application. This program will be installed on a uPC without a continuous monitoring. I've googled the way to implement the OSGi console into a bundle but i cant found nothing relevant. I'm using OSGi 3.7.1 and trying to deply on an Equinox.