Hot answers tagged command-line
There's usually nothing dangerous about adding directories to PATH. It could only cause you problems in two ways: While using a command prompt, you might accidentally run a program you didn't intend to. Then again, if you know the programs you put on your PATH, nothing malicious will happen. Programs might find DLLs there that usually aren't loaded. The ...
Batch Script - Subtracting (or adding) Days from Current Day Simplified You can do this using a batch script that sets the date variable and subtracts 1 day (or any number of days for that matter) from the current date which the batch script is executed. So you'd need to ensure that the day you schedule the script to execute, that that day is what you ...
This is done by filtering by attributes. dir [somedir] /ad will show all entries with the "directory" attribute. It also shows junction points. From dir /?: Displays a list of files and subdirectories in a directory. DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [...
Well, this is awkward. Rebooting solved my problem. It seems like I did the right steps, but without reboot it wouldn't work. Maybe this can be of help for someone else in the future.
Use head and tail. history | head -n 456 | tail -n 136 Which will get the first 456 (up to the end you want) and then you get the last 136 (which computes as 456 - 136 = 320, but will fetch from the 321st record from history).
I think it is always quite complicated to calculate dates. Therefore, I would like to propose an alternative solution to achieve what you need. I would use another scheduled task, to output the current date with the format YYYY-MM-DD in a file. You can find information on how to do that here. Then, in your scheduled job that is responsible for the zipping, ...
Wish I'd noticed this thread years ago. My solution was essentially the same as slhck's, but I wrote a script. I use it all the time. Posting here to share it. #!/bin/bash msg='all done' quiet=false if [ "$1" = '-q' ]; then quiet=true; shift; fi if [ $# -gt 0 ]; then msg="$*"; fi echo -ne "\x1b]0;$msg\a" if [ -x /usr/bin/zenity ]; then unset WINDOWID ...
What did the trick for me was moving the command into a separate batch file: rem this first batch file triggers the second one: start the_second.bat arg1 arg2 out.txt the_second.bat then looks like this: python 1st.py %1 %2 > %3
for /r %i in (*) do @echo %~ni or forfiles /s /c "cmd /c if @isdir==FALSE noquotes.bat @fname" assuming a file noquotes.bat in your %PATH% with this content @echo %~1 for /r approach explained for /r walks the current directory recursively (you can specify a directory for /r drive:\path\, the current directory is assumed) and executes the command ...
Only top voted, non community-wiki answers of a minimum length are eligible