An automated series of instructions carried out in a specific order, such as a Windows script created to launch a specific program on startup.

learn more… | top users | synonyms (1)

4
votes
3answers
2k views

How can I logoff and go to stand-by via Win XP script?

I am looking for a way to write a script (of any sort) that would both log me off my local Windows account and also immediatedly put the computer to sleep / stand-by. I've found solutions that can do ...
4
votes
3answers
727 views

Breaking a file down of strings, into separate files each based on the first letter. BASH

Alright, so I have a file full of thousands of strings. Each one on it's own line. I want to make a script that will allow me to take this file, call it list.txt, and take the items from each line, ...
4
votes
2answers
5k views

OSX 'open with' bash script

I've got a bash script, potentially many of them in fact, which I'd like to be able to open files in OSX's finder with. It's a really, really simple concept but for some reason bash scripts are ...
4
votes
3answers
8k views

Windows xp command to search for files

What is the easiest way to search for files from a command line on Windows XP? I want to look for files created since a certain date, bigger than a certain size, or on a certain drive. Ideally I ...
4
votes
2answers
13k views

How to create multiple folders and name them by reading lines from text file?

I have a plain text file named Export.txt. It contains a list of geographical places, preceeded by a 3 digit number with leading zeros. Example --START OF FILE-- 001 Aberdeen 002 Bellevue 003 Camas ...
4
votes
4answers
11k views

How to append a string to a file name in Bash Shell?

So I am supposed to find all the files in the given directory with surffix of .C or cc, and change their name to .C.blah or .cc.blah Is there a command to do that? Or should I implement this with ...
4
votes
4answers
13k views

How can I launch multiple screen sessions from a single bash script?

I've written a script (that doesn't work) that looks something like this: #!/bin/sh screen -dmS "somename" somecommand for i in {0..5}; do screen -dmS "name$i" anothercommand $i done For some ...
4
votes
3answers
303 views

How to pass a file that changes name to another command in Bash?

I frequently use wget to download tarballs and zip files from the web, then either untar then or gunzip them. I do: wget google.com/somefile.zip unzip somefile.zip rm somefile.zip Is there a way ...
4
votes
5answers
2k views

Does anyone know of a scriptable way to switch Internet Proxy LAN Settings for browsers

I have two networks at work and when I have to use my Wireless settings I need IE to use one set of Proxy LAN Settings, and when I am plugged in I need a different set. I have been looking for a ...
4
votes
3answers
1k views

Script to get images in folder with dimensions printed to a .txt file

As title goes, is there a script for Win 7 to get printed on a .txt file all the images (JPG, PNG, GIF ecc) inside a folder along with "filename" and "pixels dimension"? I've tried with dir on ...
4
votes
1answer
2k views

What scripting/programming languages are default on Mac OSX?

I was wondering what programming or scripting languages come pre-installed on OSX? Particularly programs that can be run from the command line. I'm planning on parsing some CSS, and outputting an ...
4
votes
3answers
1k views

script to run sox to combine multiple mono tracks to stereo

I have a folder full of .wav audio files. Some are stereo, most are mono splits. The mono split pairs are all named foo bar track.L.wav and foo bar track.R.wav I can use the command line tool sox ...
4
votes
2answers
2k views

Script or tool to get the IP address of a remote host

I want to set an environment variable with the IP address of a given remote host. This is the solution I've arrived to: export IP=`curl http://network-tools.com/default.asp?host=www.example.com | ...
4
votes
4answers
2k views

How to clear balloon popup from bash

I am setting a notification with notify-send in a script. The only problem is that when the script is called several times, all the notifications are added to a notification stack and only called one ...
4
votes
4answers
2k views

How to automatically launch a shell script when content of a given directory is changed

I'm developing a web project using some libraries that force me to launch a shell command to compile some files everytime i modify them. This task is obviously tiresome and i'm looking to find some ...
4
votes
3answers
5k views

Programmatically check if a Windows Server 2008 Feature is installed, and Install it

I'd like to be able to detect in a script whether a Windows Server 2008 installation has specific Windows features enabled, and install them if necessary. I do not simply want to use a "try to ...
4
votes
2answers
5k views

Run script on Windows every n minutes

What's the best way on a Windows machine to run some sort of script every n minutes? I've googled around and read that Windows Scheduler is best avoided.
4
votes
1answer
5k views

Setting file creation date in Mac OS X

I need a script to set the creation date to the modification date for a bunch of files created by my sound recorder - any way to do this? Running Mac OS X 10.4.11
4
votes
2answers
2k views

Sending mail from the command line, in an automated way

I want to be able to send a text file through an SMTP server of my ISP (port 25) to an email address on the internet, like my Office email address, or my GMail address. I have a basic Ubuntu 9.04 ...
4
votes
2answers
55 views

for loop…in a for loop…in a for loop?

So I have a bunch of locations I need to check for two possible filenames, however the directory names vary. So here's essentially what I'm trying to optimize: for /r "%ProgramFiles%\WildGames" %%i ...
4
votes
1answer
192 views

Check if there are any empty files in a folder

I have a script that downloads 17 files from a FTP server every time, but sometimes some files weigh "0" for some reasons. So I'm searching for a bash script that checks if there are any files whose ...
4
votes
1answer
230 views

Using a shell script but it fails with spaces on directory or name

I'm relatively new to Linux script and I'm having an issue with one I'm trying to use when there are spaces in the directory name or file name. The script shrinks PDF files so that i can put them in ...
4
votes
3answers
185 views

Download a pdf from a website every 24 hours?

I recently found G24, a pdf that The Guardian updates regularly with news summaries, which I can then print out. Is there a method to download said pdf every 24 hours? It has a static link, as they ...
4
votes
4answers
250 views

How to cut a file into pieces more efficiently?

Suppose I have a 10MB text file foo.txt, and it has 100,000 lines. Now, I want to process foo.txt window by window, with a window size 10. My current script is like this: for ...
4
votes
2answers
3k views

What software can I use to scrape (download) a MediaWiki wiki? [closed]

I want to scrape an entire wiki that uses MediaWiki software. The amount of pages are pretty small, but they have plenty of revisions, and I'd like to preferably scrape revisions as well. The wiki ...
4
votes
2answers
887 views

Command line too long in batch file for Gimp

I have run into an issue using GIMP's batch processing. I have a lot of files spred over a directory tree which need to be processed by a script-fu. I tried to generate a batch file which calls my ...
4
votes
5answers
4k views

zipping all files/dirs in a directory except some?

How can I make a zip of all the files and subdirectories in the directory "mydir", except all those files/dirs that begin with a ".*"? The command: zip -r mydir.zip mydir/ will include everything. ...
4
votes
1answer
4k views

Can I automatically reboot if disconnected from the internet?

I have an old desktop that I'm running as a web server from my home while I'm at college. The internet at home is crappy and a lot of times when it goes down, the desktop can't reconnect without a ...
4
votes
2answers
3k views

Use sed command to replace , appearing between numbers

I have a CSV file where data are in the following format |001|,|abc,def|,123456,789,|aaa|,|bbb|,444,555,666 I want to replace only those "," that appears between numbers with some other character ...
4
votes
1answer
519 views

how to copy I/O not just redirect (Windows and Linux)

I have a simple call command call calabash -D sim.xpl >test.txt 2>&1 and this redirects into test.txt, how do I do both redirect into a file and allow it to show up in the prompt? (I ...
4
votes
1answer
967 views

gnu screen automation

i'd like to launch GNU screen, some shell command in it, then open new screen window(s) with different command(s) - all that automatically, from a script. is it possible? UPDATE the screen windows ...
4
votes
3answers
781 views

Windows Startup and Shutdown scripts

In the group-policy editor, I see an option to add scripts to be executed on Startup and another option for scripts to be executed on Shutdown. Are these intended for personal use? And if so, are ...
4
votes
1answer
68 views

Can I create a “file” that, when opened, actually gives the output of a command?

I've found myself in a couple of situations now where I'd like to have such a "file" that essentially runs a script whenever it's "opened", allowing me to "read" it's output. For example, I might ...
4
votes
1answer
755 views

Simplest setup on Windows to send HTTP request, get and apply regex to response, and write match(es) to output file

I'd like to write a script that records the size of the close votes review queue on SO (currently ~95.5k), polling just a few times an hour, so I could plot a general trend. I know what I'm going to ...
4
votes
2answers
730 views

Bash autocomplete for different directories

I've played with bash autocomplete now for a while, but couldn't find a solution for my problem. I have a project directory with subfolders like this: projects/ruby/project1 projects/ruby/project2 ...
4
votes
3answers
1k views

Handling prompts from an installer in Linux command line

I am writing a bash script that, amongst other things, installs some software. One of the installers I run requires answering some questions. For example: Is the default install folder ok (yes/no)? ...
4
votes
5answers
779 views

Automatically wake up notebooks not on the ethernet

I am looking for an automated backup system and I like bacula. I have 3 Notebooks and a Desktop computer that need regular backup. Now I don't want to let them run all night just to do the backuping, ...
4
votes
2answers
3k views

init.d script not executing?

I have a script on ubuntu that I put in /etc/init.d. It has 0755 permissions, and I can run it manually both executing it and sourcing it, with good results. I have symlinks in both /etc/rc3.d and ...
4
votes
1answer
35 views

Batch script to delete specific folders

I want to be able to run a script at a parent folder that contains other folders, the script will delete all the folders of a certain name. So for example to remove all the bin folders and only them: ...
4
votes
2answers
1k views

Counting pages within Word [.doc] documents

I'm trying to find a way of listing the number of pages within multiple word documents, all saved within the same folder. Is this possible using VBA? I am using: Windows 7 and Microsoft Office 2007 ...
4
votes
1answer
1k views

Using launchd to kill and restart Finder in OS X

I'm trying to use a launchagent on login to kill the Finder, and then re-launch TotalFinder, to automatically apply the colorsidebar mod for OS X 10.7 (the mod can be found here). If I use the ...
4
votes
3answers
9k views

How can I manually load/unload a driver in Windows Vista?

I think one of my drivers is causing some of my Windows Vista machines to boot extremely slow. Since the perf log is basically no help, I want to try manually unloading/loading drivers to see if ...
4
votes
2answers
5k views

Is there a way to get access to a window handle in windows using WSH, or WMI or similar?

Is there a way to get access to a window handle in windows using WSH, or WMI or similar? I just want to flag a window as always-on-top. Ideally I'd use windows script host for this. (Should also be ...
4
votes
2answers
413 views

How to invoke actions from an executable in PowerShell?

I am using Powershell 2.0 on Windows 7 SP1, but any answers covering versions 1.0-4.0 would be nice. I know that this command opens Paint via PowerShell: & "C:\Windows\system32\mspaint.exe" ...
4
votes
3answers
2k views

Logout user script

I am trying to create a script in ARD that will let me logout a user. Now I have a script which does start the logout, but I want it to execute instead of waiting 60 seconds. The script currently ...
4
votes
1answer
118 views

Extract data from an online atlas

There is an online atlas that I would like to extract values from. The atlas provides a tool ('Query') to extract values when you click a location or enclose a region on the map, or you can specify ...
4
votes
3answers
2k views

Windows command prompt freezing randomly

My Windows command prompt will randomly freeze up when running an Ant script. The script has no spots in it where it waits for user input. Also, when it freezes I can unfreeze it by focusing the ...
4
votes
3answers
39k views

Temporarily Disable Symantec Endpoint Protection?

I would like to temporarily disable Symantec Endpoint Protection. I know that this is done by right clicking the tray icon in the Windows, and then clicking enable/disable. What I would like to do ...
4
votes
3answers
181 views

Delete all files in folder except those with certain prefix

I have a folder being filled with auto generated files by an application. There are csv and png extensions being created and stored in there. We need to delete all files in the folder except certain ...
4
votes
1answer
2k views

Unlock PC with Windows Task Scheduler

I need to set up a Scheduled Task to unlock Windows 7 PC at specific time. And second Task, to lock at other specific time. Is this possible by cmd.exe command, or I need to use some third party ...