Provide one line PowerShell script that you found useful, one script per answer please.
There is a similar question here, but this one gives only links to pages with scripts, lets answers one by one here and have a contributed list of most frequently used or most useful scripts.
1.List most recent version of files
ls -r -fi *.lis | s...
I have a bash script that runs a program with parameters. That program outputs some status (doing this, doing that...). There is no option for this program to be quiet. How can I prevent the script from displaying anything?
I am looking for something like windows "echo off".
...
To solve a problem listed here I've got to change the InstallExecuteSequence .RemoveExistingProducts record in an MSI.
I want to do this as part of the build process rather than mucking around with Orca
...
In the windows shell:
echo "foo bar" | find "foo"
succeeds (i.e. errorlevel = 0). However, I want a script that fails (i.e. errorlevel <> 0) when it finds a particular word in some input text. Any ideas?
...
Is it possible to perform a HTTP Request with specific header fields (like 'referer', 'cookies' or 'User-Agent') using Windows Script Host or any other Windows scripting technology??
Thanks.
...
Hi
I want to view the ORA errors in alertlogfile of past 7 (monday-sunday)days,
by writting in shell scripts.
Can anybody help me.
Thanks
...
The following code prints me a long list of files with hashes and file names
md5sum *.java
I have tried unsuccessfully to list the lines where identical hashes occur, so that I can then remove identical files.
How can you filter and delete identical files which have same content?
...
I have an HTML form that submits to a PHP page which initiates a script. The script can take anywhere from 3 seconds to 30 seconds to run - the user doesn't need to be around for this script to complete.
Is it possible to initiate a PHP script, immediately print "Thanks" to the user (or whatever) and let them go on their merry way while...
Exact Duplicates:
How to write a batch file to delete the files which are 5 days or older from a folder?
write a batch file to delete 6 days older files from a folder
write a batch file to delete 5 daya older files from a folder
How do I create a batch script that will delete a folder on a scheduled basis?
write a batch file to remove ...
I'm hoping to use Ruby as a scripting language for my game engine. I've found the usual articles describing how to call Ruby classes from C++ code and vice versa (e.g. here) but I can't quite see how to do what I want with that way of working...
My engine currently uses a little language I wrote myself with Flex and Bison, and a little ...
I often have to login to one of several servers and go to one of several directories on those machines. Currently I do something of this sort:
localhost ~]$ ssh somehost
Welcome to somehost!
somehost ~]$ cd /some/directory/somewhere/named/Foo
somehost Foo]$
I have scripts that can determine which host and which directory I need t...
I have two versions of a very large and complicated directory structure with tens of thousands of individual files and I want to look for significant file changes from one version to another.
Each and every file has changed in some minor way. For example you might have a file called intro.txt which would contain
[Build 1057 done by Mi...
What is a good windows/xp or Vista scripting language that would provide basic functionality similar to what ksh or bsh does for unix?
looking to do simple/quick tasks, build parameters, call executables (.exe), redirect output.
Thanks.
...
I'm doing some debugging, which involves checking logfiles name "blah N.log" where N is an integer. Periodically, a new log file gets added, and I'd like to just skip to the next log file, rather than explicitly do :e blah\ N.log. I can't just do % vim *.log and then :n, b/c not all the log files exist yet.
I've got an expression that...
Scenario:
You are doing your daily Bash shell stuff. You want to run a previous command so you type:
history | grep foocommand
Then you get a list of all the foocommand stuff you did for however long your history has kept track, in a list like so:
585 foocommand --baz --bleet
750 foocommand | grep quux
987 history grep | fooco...
Hello,
I have written a little script which retrieves pictures and movies from my camera and renames them based on their date and then copies them on my harddrive, managing conflicts automatically (same name? same size? same md5?)
Works pretty well.
But this is ONE script.
From time to time I need to check if a picture is already hidde...
I am looking into designing a game scripting language and was wondering what people employed in the games industry considered essential items/properties for a good game scripting language. This includes things like:
static vs dynamic types
Who should it be aimed at:
programmers or designers?
syntax(must it look like C?)
How high level...
I've used the following script to see if a file exists:
#!/bin/bash
FILE=$1
if [ -f $FILE ];
then
echo "File $FILE exists."
else
echo "File $FILE does not exist."
fi
What's the correct syntax to use if I only want to check if the file does not exist?
#!/bin/bash
FILE=$1
if [ $FILE does not exist ];
then
echo "File $FILE do...
I would like to automate the following task with a script
to create an IIS script mappings for my project:
Go to Control Panel | Administrative Tools
Open Internet Information Services
Right-click the Default web site and select Properties.
In the Properties dialog-box select the 'home Directory' tab.
Click on the configuration button ...
I'd like to rename some files that are all in the same directory. The file name pattern used is Prefix_ddmmyy.tex with a european date format. For the sake of readability and the ordering I'd like to rename the files in a pattern Prefix_yymmdd.tex with a canonical date format.
Anyone ideas how I can do this automatically for a complete ...