cmd

Run cmd from browser - by JS

99封情书 提交于 2020-02-02 11:13:17
问题 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) + ' '

Executing an HTA Application via PSEXEC with command line arguments

僤鯓⒐⒋嵵緔 提交于 2020-02-01 09:22:12
问题 I have an .hta application that accepts two command line arguments. Executing the application on the remote machine via command line works just like the following (command line - cmd)Example: C:\Users\<user>\Desktop>MSI-BUILDER.hta "MSI_APP" "D:\APP\15.9.98" But when using my desktop trying to execute the same command on the remote machine via PSEXEC I see the application running in task manager but nothing happens. The first steps were assigning the command line arguments to variables in

How to decrypt multiple pdf files using qpdf?

£可爱£侵袭症+ 提交于 2020-02-01 04:11:05
问题 I have some n number of pdf files which are SECURED( i.e not password secured, but owner secured). I was able to decrypt single pdf at a time using _ "qpdf --decrypt Input.pdf Output.pdf" from Cmd Promt in Windows. can you help me to do the same with multiple pdf's using batch file or from cmd prompt. 回答1: @echo off setlocal enableextensions disabledelayedexpansion if not exist output\ md output for %%a in (*.pdf) do qpdf --decrypt "%%~fa" "output\%%~nxa" Create an output folder under current

Displaying unix color on windows cmd (e.g. ←[31m)

时间秒杀一切 提交于 2020-01-31 08:53:18
问题 I've recently started doing some ruby on rails development on Windows 7 and have found a number of commands (rspec, guard, etc) output colour codes that just show up in text on the windows command line (or through Console2 which I use). eg: ←[31mrspec ./spec/views/users/index.html.erb_spec.rb:21←[0m ←[36m# users/index renders a list of users←[0m ←[31mrspec ./spec/requests/homes_spec.rb:9←[0m ←[36m# Homes GET /homes ←[0m ←[31mrspec ./spec/views/users/new.html.erb_spec.rb:13←[0m ←[36m# users

Displaying unix color on windows cmd (e.g. ←[31m)

…衆ロ難τιáo~ 提交于 2020-01-31 08:51:32
问题 I've recently started doing some ruby on rails development on Windows 7 and have found a number of commands (rspec, guard, etc) output colour codes that just show up in text on the windows command line (or through Console2 which I use). eg: ←[31mrspec ./spec/views/users/index.html.erb_spec.rb:21←[0m ←[36m# users/index renders a list of users←[0m ←[31mrspec ./spec/requests/homes_spec.rb:9←[0m ←[36m# Homes GET /homes ←[0m ←[31mrspec ./spec/views/users/new.html.erb_spec.rb:13←[0m ←[36m# users

Can't check signature: public key not found

孤街醉人 提交于 2020-01-30 14:27:09
问题 I try to decrypt file using following command: gpg --output file.txt --decrypt file.pgp File is decrypted successfully but i get an error: "gpg: Can't check signature: public key not found" Any idea, why I get this error? 回答1: You get that error because you don't have the public key of the person who signed the message. gpg should have given you a message containing the ID of the key that was used to sign it. Obtain the public key from the person who encrypted the file and import it into your

Problem with nested FOR-Loop and IF-Condition

混江龙づ霸主 提交于 2020-01-30 11:17:43
问题 I have some lines of text. Then I have a list with test-words. I like to look up each line of the text and check if one of the test-words appears in it. Beforehand this works well with a commands like these: IF not "!stringToTest:%searchstring%=!"=="!stringToTest!" However, now this seems to be more complicated as I have nested Loops? I try to create a little MWE for my problem: @echo off setlocal enabledelayedexpansion set /a counterPC=0 set "listPC=Win10,Motherboard,USB-Port,Core" FOR %%G

Why does a batch file switching current directory for command prompt not work on using SETLOCAL command?

ε祈祈猫儿з 提交于 2020-01-30 08:22:48
问题 I am running the following batch script from within a command prompt window to go to a specific folder. @echo off SETLOCAL set ispyfolder=true if not "%~1"=="py" if not "%~1"=="pyfolder" set ispyfolder=false if "%ispyfolder%"=="true" ( C: cd C:\Users\ankagraw\AppData\Local\Continuum ) This code doesn't work when SETLOCAL is there (2nd line). The current directory is the same as before running the batch file from within a command prompt window. If I remove this line, then the script works fine

Escaping a batch file echo that starts with a forward slash and question mark

淺唱寂寞╮ 提交于 2020-01-28 00:07:34
问题 Bit of a tricky one. How can I correctly escape the following in a batch file? echo /? display this help text This particular combination of characters is treated as an "ECHO /?" command: C:\Batch>ECHO /? display this help text Displays messages, or turns command-echoing on or off. ECHO [ON | OFF] ECHO [message] Type ECHO without parameters to display the current echo setting. It does not respond to caret (^) escaping, ie. I've tried ^/? /^? and ^/^?. NB: As a workaround, I found that

Windows console width in environment variable

有些话、适合烂在心里 提交于 2020-01-27 08:18:44
问题 How can I get the current width of the windows console in an environment variable within a batch file? 回答1: I like the approach using the built-in mode command in Windows. Try the following batch-file: @echo off for /F "usebackq tokens=2* delims=: " %%W in (`mode con ^| findstr Columns`) do set CONSOLE_WIDTH=%%W echo Console is %CONSOLE_WIDTH% characters wide Note that this will return the size of the console buffer, and not the size of the window (which is scrollable). If you wanted the