cmd

Escaping outputs in CMD

大兔子大兔子 提交于 2020-02-05 06:29:13
问题 If I run something that returns with a & or some other character that has special meaning, and I try to use it in a script, how would I escape it? An example would be if I shared a local account with someone in the same computer, and I had a username that says John & Matt. Putting a batch file in the Desktop directory that had something like this: @ECHO OFF echo %~dp0 It would return something like this: C:\Users\John The system cannot find the path specified. And the whole script from that

How to install Xlib on Windows (eclipse , c language)

我的未来我决定 提交于 2020-02-05 06:11:30
问题 Ok, I need to use this for graphical programming, GUI, for cs 349 uwaterloo first assignment. I see random Xlib.h and Xutil.h files lying around on google search results. But no where does it say how I install or download Xlib from some website of something. I even tried to copy paste the Xlib.h onto a new files I created in my blank project and it has more than 100 errors. So... what do I do? 回答1: Simpliest way is to install cygwin - you'll get gcc + other tools (binutils, make, autotools)

How to install Xlib on Windows (eclipse , c language)

我只是一个虾纸丫 提交于 2020-02-05 06:11:26
问题 Ok, I need to use this for graphical programming, GUI, for cs 349 uwaterloo first assignment. I see random Xlib.h and Xutil.h files lying around on google search results. But no where does it say how I install or download Xlib from some website of something. I even tried to copy paste the Xlib.h onto a new files I created in my blank project and it has more than 100 errors. So... what do I do? 回答1: Simpliest way is to install cygwin - you'll get gcc + other tools (binutils, make, autotools)

How to install Xlib on Windows (eclipse , c language)

孤人 提交于 2020-02-05 06:10:25
问题 Ok, I need to use this for graphical programming, GUI, for cs 349 uwaterloo first assignment. I see random Xlib.h and Xutil.h files lying around on google search results. But no where does it say how I install or download Xlib from some website of something. I even tried to copy paste the Xlib.h onto a new files I created in my blank project and it has more than 100 errors. So... what do I do? 回答1: Simpliest way is to install cygwin - you'll get gcc + other tools (binutils, make, autotools)

goto unexpected with blank choice

青春壹個敷衍的年華 提交于 2020-02-05 05:17:07
问题 My problem: I set a VAR with prompt and three IF to let choice. Fourth choice doesn't work. I would like that if i push enter without type anything, it goes back to :MOSTRA. Actually leaving it blank and typing enter on the keyboard it give back GOTO WAS UNEXPECTED and close CMD. Where am i wrong? :MOSTRA ECHO Make your choice. ECHO. ECHO A) Ok ECHO B) Ko ECHO Esci SET /P choose=Scelta: if /I %choose%==A GOTO OK if /I %choose%==B GOTO KO if /I %choose%==esci GOTO FINE if /I %choose%=="" GOTO

Winrar command line not deleting recursive when not using Wildcards

时光毁灭记忆、已成空白 提交于 2020-02-05 04:36:08
问题 I'm trying to delete some files in a WinRar Archive using the Command Line. The Rar-File: /testing.rar /testing.rar/some-data.txt /testing.rar/testing/some-data.txt Here's my Code: cd "C:\Program Files\WinRAR\" && rar d -cl -r "c:\full\path\testing.rar" some-data.txt It only deletes the some-data.txt file in the root, not inside /testing/ When using cd "C:\Program Files\WinRAR\" && rar d -cl -r "c:\full\path\testing.rar" some-data.* (changed the extension to .*) it does delete both files. Am

Rscript and UNC paths

穿精又带淫゛_ 提交于 2020-02-04 01:36:46
问题 I have an R script that I would like to run from the command line using Rscript.exe in Windows. The script runs fine if I open it in RStudio but when I run it through Rscript in the command line it fails because I have UNC paths in my script. For example, read.csv("//server/directory/file.csv/") Rscript fails and says the directory does not exist. Is there anyway to resolve this problem? 来源: https://stackoverflow.com/questions/37702472/rscript-and-unc-paths

Different behaviour and output when piping through CMD and PowerShell

不羁的心 提交于 2020-02-02 13:16:43
问题 I am trying to pipe the content of a file to a simple ASCII symmetrical encryption program i made. It's a simple program that reads input from STDIN and adds or subtracts a certain value (224) to each byte of the input. For example: if the first byte is 4 and we want to encrypt, then it becomes 228. If it exceeds 255, the program just performs some modulo. This is the output I get with cmd (test.txt contains "this is a test"): type .\test.txt | .\Crypt.exe --encrypt | .\Crypt.exe --decrypt

How to follow a symbolic/soft link in cmd or PowerShell?

痴心易碎 提交于 2020-02-02 12:31:10
问题 My searches have only shown me how to create symbolic links using mklink in cmd. I have seen some things saying to use readlink , but PowerShell and cmd don't know what readlink is, and cd obviously doesn't work. So how do I follow one? 回答1: For your question i made this batch file: mkdir truedir dir > truedir\fileone.txt mklink /d symdir truedir cd symdir dir And i have found no problem to get the content of the symblic link to a directory from command prompt. No problem also with powershell

Run cmd from browser - by JS

孤者浪人 提交于 2020-02-02 11:16:14
问题 I want to open cmd window from my web page(HTML). I'm using JS but something is not right because when i press, the function isn't called. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script type="text/javascript"> <!-- function runCmd(command, option) { var char34 = String.fromCharCode(34); var wsh = new ActiveXObject('WScript.Shell'); if (wsh) { command = 'cmd /k ' + char34 + wsh.ExpandEnvironmentStrings(command) + ' '