Tag Info

New answers tagged

0

To (somewhat) add on to Dennis Williamson's answer, you can also escape the pipe character in order to pipe commands! For example, I wanted a command that copies stuff to the clipboard. Due to the way COPY will interpret it, you need to do a goofy looking command for it to actually copy the text you specify without it being followed by a newline. In order ...


0

@haridsv most doesn't even have hjkl scrolling so I don't think it's a surprise it doesn't support other vi keys. It's just a better version of more not a less replacement.


0

Your command is wrong because you're executing the first command and then you're sending the output to the at command. I don't know why, but it seems that it works if you wrap your command with echo: echo "your command" | at now + 3minutes


0

You can exclude all files matching a certain pattern using the -x flag of diff. The following line should exclude all hidden files in all directories you diff: diff -x '.*' -rq folder1 folder2


0

FileZilla does not have any command line arguments (nor any other way) that allow automatic transfer. See: https://wiki.filezilla-project.org/Command-line_arguments_(Client) http://trac.filezilla-project.org/ticket/2317 Though you can use any other FTP client that allows automation. For example WinSCP: http://winscp.net/eng/docs/guide_automation ...


0

I just found a blog post, which seems to be answering this question with a bash script. http://scruss.com/blog/2013/05/12/clean-up-your-gnupg-keyring/


0

This c:\> for /? ... will list how for works, look for the line FOR /F ["options"] %variable IN (`command`) DO command [command-parameters] and read about it. Now note that %variable is LOCAL to for so you need to have e.g. set F=%variable after command C:\> for /F "usebackq" %v in (`echo Check-it-out`) do @ set F=%v C:\> echo To do: %F% ...


0

The "Path" system variable is different depending on which applications you've installed. However, as a starting point, the following is included with Windows itself. %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem If you use PowerShell, add: %systemroot%\System32\WindowsPowerShell\v1.0\ If you use Windows Live (including Windows ...


0

"EM64T" is also a possible value, however unlikely. My understanding is that you will only see this with XP-64.


0

Can you specify which OS you're on: MAC/Windows/Linux.... Under Linux it's simple, just close the terminal window you're in. The PATH environment variable is restored when a new tab is opened. Probably similar in newer (2004+) MACs. Windows... that's tricky because the more applications you have installed the more chance you have of other applications ...


0

As pointed out by @Tyson, the PATH variable holds the answer. I just wanted to point out that using full paths in your scripts is usually considered a good practice. For example, instead of calling wc you might want to call /usr/bin/wc. Besides resolving the above problem, it's more secure, as you prevent running an application that someone might have ...


0

Using find more simply like this: find <from_where_to_change> -not -path "*/<excluded_dir_name>*" [-and -not -path "*/<another_excluded_dir_if_you_want>*"] -exec chown <user>[:<group>] {} \; In my case it was: find /data/project -not -path "*/.svn*" -exec chown :www-data {} \; This way I changed group on folder ...


0

Switches /w, /ip and /m relate to pkgmgr.exe rather then start. Here is a link to MS website were switches and options for pkgmgr.exe are described in the details Try removing start /w from your command. It is only used in batch scripts to ensure sequential execution of commands. You don't need it when running one singe command from the terminal. Just do ...


0

If you are working in Virtual Environment It will put hand disk on Standby Mode: sudo /sbin/shutdown -h now.


0

The username that you'r using with su might not be a super user. Just type like this, su screen -S -p 0 -X eval 'stuff "say command"\015' then type your password


1

You can invoke the correct uninstaller without knowing the GUID etc. by using WMIC. To see a list of the names of the programs as known internally by Windows: wmic product get name Look for your product name. It probably matches the one listed in the "Programs and Features" control panel, but not always. Then you can use wmic product where ...


0

From (https://openhatch.org/missions/windows-setup/install-git-bash) we can read Git Bash has a silly name. It's comprised of two parts: - git: a version control tool we have a training mission about, and - bash: a shell that runs commands once you type the name of a command and press on your keyboard. More specifically following an excerpt ...


0

If your textfiles (*.txt) already are associated with pspad, you can use the following command to do just that: start mytext.txt The command start will start a program with optional parameters. If you ask to launch a file, it will instead open that file by the associated program in windows. If you use start followed by a path (directory) with no file, the ...


1

That vbscript file you give in your question works You could say set /p yyy=input number: or %ID% as you have. Below I change i <= 4, to i <= %yyy% yyy=44 so it becomes i <= 44 C:\blah>type a.a var i; for (i = 1; i <= 4; i++) { iimSet("loop", i); iimPlay("ABC.iim"); } C:\blah>set yyy=44 C:\blah>replace a.a "i <= 4" "i <= ...


1

Unfortunately this answer doesn't do any "searching", but your file could be easily re-written in a small number of lines, so it may be easier to re-write the file contents...? set /p ID="Enter Number: " @echo off @echo var i;> javascript.js @echo for (i = 1; i ^<^= %ID%; i++)>> javascript.js @echo {>> javascript.js @echo iimSet("loop", ...


0

Try this one: start /b /d "volume.exe NameOfInputFile.txt string1 string2"


0

Not sure if I understood the question correctly, but if I did, then you have just answered your own question with this line: E.g. pspad "text file location" that will open text file in PSPad That is exactly what you need. Most programs that are designed to open the files of some format take the URL of the file as the CMD argument. So supplying the path ...


0

Try this by surrounding the name of file NameOfInputFile.txt in quotes you pass it as string argument and not as a file. start /b /d volume.exe "NameOfInputFile.txt" string1 string2


0

zsh is running properly, but there are syntax differences between bash and zsh for displaying the prompt. You need to set the PS1 variable to something zsh recognises. Edit your ~/.zshrc file and add something like export PS1='%m%# ' Mine is quite complicated and set to %*%F{green}[%K{black}%B%F{red}R%?%F{blue}S%L%F{magenta}J%j%b%F{green}]%n@%m%f[%!] ...


0

With Mac OSX I use an alias in my .bash_profil alias google=sh ~/scripts/google.sh google.sh: #!/bin/bash open -g /Applications/Safari.app "http://www.google.com/search?q=$*" Usage: google word1 word2 ... This way works fine for me. cheers


0

It is possible now. You can compile and run your code entirely in ST, and it's very quick/simple. There's a recent ST package called Javatar that can do this. https://javatar.readthedocs.org


0

if exist "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\file.txt" ( copy "\\server\share\file.txt" "\\MachineName\C$\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\file.txt" )


0

I was looking at this a couple days ago but haven't tried it yet. Windows Firewall: netsh advfirewall firewall set rule group="remote desktop" new enable=Yes Registry key: reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f found here:How to enable remote desktop from command line


2

To allow remote assistance in firewall: netsh advfirewall firewall set rule group="remote assistance" new enable=Yes For adding/editing a registry key: reg add "HKLM\System\CurrentControlSet\Control\Remote Assistance" /v fAllowToGetHelp /t REG_DWORD /d 1 /f


0

Here you go replace copy file cmmand with your copy command Edit replace PATH\FILE with the destination you are checking. if NOT EXISTS PATH\FILE ( copy file command here )


2

This is usable from CMD or a batch file, and should do what you need on any system running Windows 7 or later: powershell -command "& {dir *.zip | sort LastWriteTime -Descending | select -First 3}"


0

Just set VAR at the end again. There is no limitation in how often you can set a variable. Remember, a batch file is only a list of commands you could type in the command prompt. Every row is basically one command at a time executed in chronological order. So if you need to have VAR elevated with the right conditions, set it just before that moment. ...


1

That will not be possible. Once a variable is assigned a value, it is no longer dependent on the variable or text that was used when assigned. The easiest way to achieve your desired output is to simply echo the VA variable and the text at the end. Basically, do all your computations, then at the end put together your output. @echo off setlocal ...


0

For Windows 8, there is WDK 8.1 available at http://msdn.microsoft.com/en-US/windows/hardware/gg454513 The small setup binary allows to download (without installing WDK) (~500MB) and without iso-container. Searched cabs for devcon.exe but names are scrambled. Used Universal Extractor to extract "..\Installers\Windows Driver Kit-x86_en-us.msi" - ends with ...


0

No built-in (DOS) way that I know of, but if you have some common "UNIX" tools available, this will work: dir /s /p Portal.sln | grep "^ Directory of" | sed -e "s/^ Directory of //" | open.pl where open.pl is: #!perl use strict; use warnings; $| = 1; if (scalar(@ARGV) == 0) { print "Please enter the file or folder path you would like to open:\n"; ...


0

I know this is not the exact solution for your question, but you can always open a command prompt at a specified location by navigating to the desired location using windows explorer and then by pressing shift + right click and clicking "Open command window here". If you already knew this, please disregard this. Hope it helps.


0

I'm afraid I cannot recall where I found the following solution. Sorry. However, since it worked optimally for me I add it here. Make sure that your .emacs starts the emacs server. (server-start) Next, in your .bashrc define the function: function run_emacs { /usr/bin/emacsclient "$1" & } and set the environment variables: export ...


0

Does it work if you use Win+R from the Desktop to start cmd.exe? My guess is that starting it from the Start Screen causes the started cmd.exe's parent to be different from explorer.exe (WSAHost.exe, IIRC or whatever it's named), and that parent process doesn't update it's environment during WM_SETTINGCHANGE messages. I don't have a Windows 8 machine on hand ...


1

Why is this happening? You didn't provide other examples besides Bitvise, but it seems to be a UAC prompt issue. If the program doesn't run with the elevated privileges it requires, and thus is required to display a UAC prompt, output is written to a different (new?) STDOUT. Thus the second cmd window AND why standard text redirection to an output file ...


0

Seems like those may only for deleting the files if you're adding them to an archive. Seems to be the case, yes, $ unrar --help | grep -i unrar UNRAR 5.00 beta 8 freeware Copyright (c) 1993-2013 Alexander Roshal Usage: unrar command -switch1 -switchN archive files... $ unrar --help | grep del $ unrar --help | grep unlink $ unrar --help | grep ...


2

Windows includes robocopy built in, which copies multiple files from a single command: robocopy a\source\folder a\dest\folder file1.docx file2.exe


0

I know this is old, but I built a batch ui that does the same as above, but allows for user input and you can set shortcut file, icon and name. @echo off echo. echo "Type or drag and drop the file you would like a desktop shortcut for below." echo. set /p FileLoc=" Location of target file: " cls echo. echo "Type or drag and drop an icon for your ...


0

I don't quite understand your line of code there; perhaps it has been garbled. My approach would be a bit different: First, create an alias that takes the output of a program and makes a cd to that: alias mycd='cd $(select-dir)' Then make the program print the menu to stderr and the choice to stdout, for example like this: #!/usr/bin/perl use 5.010; ...


1

Copy the contents of the cmd window and past it into Word, or other text editor. See Microsoft's documentation on how to copy text from a command prompt window.


0

Alternatively, you can use the shorter command start .


0

I know it's a windows question (and an old one at that), but maybe it's similar to Linux and OSX. This is the first thing that came up when I was looking for a simple command to keep network traffic on my laptop. Might be useful to someone looking for something similar. in a bash script: WAITSECONDS=30 #or whatever your needs are IPTOPING=8.8.8.8 #or ...


1

Finally, UAC disable/enable without reboot: C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t ...


0

http://stackoverflow.com/questions/17981391/delete-firewall-rule-using-powershell-on-windows-7 The link above contains solutions for Disabling or Deleting Firewall rules, for example: Use netsh to delete firewall rules: netsh advfirewall firewall delete rule name="$ruleName" To disable a firewall rule: function Disable-IncomingFirewallRule($ruleName) ...


1

Try add cat <&0 to your script where you want to carry out the redirection job. The &0 above represents the stdin file descriptor, and you're essentially putting things you get from stdin to cat. Alternatively, use the following loop to do it yourself: while read line do echo "$line" done


0

All answers suggest to use third-party tools but you can use simple move you just need to determine correct recycle bin path. In XP it is C:\RECYCLER, in Vista and later C:\$Recycle.bin. However that is not everything, it is just a main folder but it contains sub-folders and these are actual bins where you need to move your file. For example, in my machine ...



Top 50 recent answers are included