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)

41
votes
2answers
34k views

How to launch a command on network connection/disconnection?

I have a wifi connection that requires to authenticate using a web form once the wireless link is established. I know how to automate the authentication with a script that uses curl/curlIE. But how ...
102
votes
7answers
48k views

What is the difference between executing a bash script and sourcing a bash script?

What is the difference between executing a bash script like A and sourcing a bash script like B? A >./myscript B >source myscript
238
votes
27answers
136k views

How to execute a command whenever a file changes?

I want a quick and simple way to execute a command whenever a file changes. I want something very simple, something I will leave running on a terminal and close it whenever I'm finished working with ...
42
votes
9answers
93k views

How can I run an application with command line arguments in Mac OS

Is there any easy way to append command line arguments to an application on a Mac? For example, to run Opera in kiosk mode or to use a different profile in Firefox, I can type $ /Applications/Opera....
35
votes
12answers
71k views

Which command can I use to recursively rename or move a file in Windows?

What command in Windows emulates the recursive move / rename command from Unix?
20
votes
6answers
75k views

Automatically run a script when I log on to Windows

How can I automatically run a script when I log on to Windows? I'd like to run something like this whenever I log into my computer: echo %USERNAME% logged on at %DATE% %TIME% >> log.txt A ...
13
votes
3answers
14k views

Create a logoff script/task for Linux

In similar vein to my question for Windows and Mac OS X, how would one go about creating a logoff script for Linux? Any distro is fine, as I'm sure it'd be extendable across others. I'm most ...
96
votes
18answers
27k views

Add directory to $PATH if it's not already there

Has anybody written a bash function to add a directory to $PATH only if it's not already there? I typically add to PATH using something like: export PATH=/usr/local/mysql/bin:$PATH If I construct ...
21
votes
4answers
68k views

Change DNS with script

I need to frequently change the DNS server address, and for now I do it by opening 'network and sharing center' - 'local area connection' - properties - ipv4 - and then type the DNS numbers. Is there ...
3
votes
3answers
4k views

How can I take hundreds of smaller images and create one big tiled image?

I have 251 images that are 128x128 in size; I need to create one big image that includes them all tiled together. The image will be 32128x32128 in size if all goes well (Paint.NET says it will be 3....
7
votes
3answers
2k views

How can I receive phone calls on a Linux server and script stuff depending on the numbers pressed?

I live in France and the ISP I've subscribed to provides a regular phone line along with my Internet connection. Here's a simple schema of my setup: Since I don't use this phone line I would like ...
41
votes
8answers
70k views

How can I get a script to run every day on Mac OS X?

Cron? Launchd? iCal?? If so, how?
23
votes
2answers
39k views

Can I make a script always execute as root?

How to make a script execute as root, no matter who executes it? I read about setuid but I'm not sure how to do this. I'm using Linux, Ubuntu 12.04 LTS.
10
votes
1answer
64k views

How to get filename only without path in windows command line?

for /r %f in (*) do echo %f Gives the output filename along with the entire path \path\to\dir\<filename> How do i get just the <filename> without the path included? I need to use that ...
6
votes
1answer
14k views

Set Permanent Environmental Variable in Windows XP

I want to set environmental variables permanently through a batch file. Is there a command to set Permanent Environmental Variable (other than SETX) for Windows XP service pack 3? command SETX ...
6
votes
5answers
24k views

How to replace a single character in Windows filenames using a batch file?

I have a Windows Server 2003 server that has a whole bunch of filenames that need renaming. Basically, I just need all - (hyphens) replaced with _ (underscores), no matter where they are in the ...
11
votes
5answers
3k views

Move some iTunes library items to different drive?

My internal hard drive is somewhat small, and I only regularly listen to a fraction of my iTunes library anyway, so I'd like to keep large portions on it on an external drive for archival purposes. ...
11
votes
8answers
62k views

How to get my external IP address (over NAT) from the Windows command-line? [duplicate]

The Windows "ipconfig" command can only show me the parameters from the Ethernet interfaces from my machine (even with the ipconfig /all argument). It can show detailed information about the interface,...
11
votes
3answers
2k views

Calling a script with ./bla.sh vs. . bla.sh

Can anybody explain to me what the shell does in the two examples A) and B) below? It obviously behaves differently, but I can't find out why the output is different. Example: Let's have a script in ...
3
votes
2answers
4k views

Windows Script Host Error Dialog Popups in the morning

A few days ago when I resume my computer from sleep mode in the mornings I would see an error dialog from "Windows Script Host" that read: "There is no script engine for file extension ".vbs". I am ...
3
votes
3answers
11k views

Input Error: There is no script engine for file extension “.vbs”

I keep getting it in command prompt, any idea why and how I may resolve the issue? Windows 7 Ultimate 32-Bit
2
votes
2answers
1k views

Open browser window at specified screen / coordinates

A customer has a 6-screen setup for each workstation and would like various pages of a web app to be opened automatically in each of the screens on startup or invoking a shortcut. (The target web ...
1
vote
3answers
5k views

Create a logoff script/task for Windows

Without using AD GPOs (Active Directory Group Policy Objects), or similar, how would one go about creating a logoff script for Windows? This would be for XP (home and pro), Vista, and 7, in a ...
23
votes
4answers
55k views

Remotely run script on Unix, get output locally?

I need to run a (Tcl, or whatever) script on a remote Unix machine, from a (local) Windows command shell, and I want the stdout/stderr of the script to show up in the Windows CLI. The exit code would ...
6
votes
2answers
11k views

How to list manually installed software packages in Ubuntu? [duplicate]

Possible Duplicate: How do you track which packages were installed on Ubuntu (Linux)? Hello, I'm using apt-get install to install various software on my PC. I have a handful of PCs that needs ...
10
votes
4answers
67k views

How do I set the desktop background on Windows from a script?

On X Windows I had a cool 'silent-alarm" reminder script that would change my root window (background) color to solid red, just for a few seconds a few moments before changing it back. Is there a way ...
17
votes
4answers
64k views

How to disable ipv6 on a specific interface in linux?

Could someone tell me how to disable ipv6 auto-config on a specific network interface in CentOS? The current situation is: A PC has two network adapters eth0 and eth1 that are connecting to the same ...
16
votes
3answers
8k views

How to extract a complete list of extension types within a directory?

Within a directory, and recursively within it's sub-directories, meaning every directory within a directory is processed, how do I compile a complete list of unique extensions within the directory? ...
8
votes
3answers
43k views

How do I change automatic logon via Script or Command Line?

After deploying a Windows 7 image to Stand alone machines we run into the following problem. If we set autologon to off then we have to log in manually and activate Windows and Office - the Keys ...
3
votes
3answers
29k views

How do you update an Excel file (Data Refresh and update formulas) WITHOUT opening the file?

I have an Excel file that want to update and save automatically with out having to open it or manually interact with. Manually, I open the file up and hit data refresh which goes and does a SQL query ...
12
votes
7answers
9k views

Best practices to alias the rm command and make it safer

Some time ago I erroneously deleted my home folder because I ran a rm -rf * on the wrong terminal, whose working directory was the home folder! I wish I had an alias for the rm command, but it was ...
12
votes
3answers
11k views

How to execute a script on sleep, hibernate, resume, and shutdown

I keep alot of my classwork documents hosted on dropbox as well as my personal site for remote storage. This helps alot since I switch between an iPad, laptop and desktop, so there are no worries ...
-13
votes
2answers
25k views

How can I run a web page in task scheduler every day? [duplicate]

Possible Duplicate: How can I open a URL on a schedule in the default browser? Tomorrow I will go holiday and I can't connect to internet for 5 days. In my SO account I have 64 consecutive day ...
6
votes
4answers
3k views

Hook into linux mount/umount event

is there a way to provide post-mount and pre-umount scripts in Linux? I am trying to do some scripts on storage media when mounted and before umounting (eg, for synching). Any help appreciated.
5
votes
7answers
3k views

Dos and/or Windows versions of Unix SCRIPT command

Back in university, when we had to submit an assignment in CS, we would have to perform a series of steps including running script, date, whoami, etc., and then running our program. The script ...
4
votes
3answers
8k views

How can you automatically run a script after connecting to a VPN on OS X?

I have configured the VPN connection in OS X 10.7.3, but since the network I'm connecting to uses a corporate proxy, has custom Maven repository servers, and other network-specific settings (remote ...
2
votes
2answers
1k views

Permission Denied running python script from samba share

I'm trying to mount a samba share on a Ubuntu 12.04 desktop from a Fedora 17 desktop. I can create, edit and delete files with no problem but when I try to run python scripts on the share i get a ...
5
votes
3answers
9k views

Windows 7 - How to run a script at shutdown but not at logoff

I was wondering if anyone knows how to configure a Windows 7 x64 Enterprise install that is on a domain to run a script if the user attempts to shutdown the computer - but I dont want the script to ...
2
votes
1answer
5k views

Create a logoff script/task for Mac OS X

Related to my other question on Windows, how would one go about creating a logoff script for Mac OS X?
1
vote
4answers
868 views

Some websites prompt to download PHP script after some time, but only in Firefox

This happens only in Firefox - NOT in IE or in Safari (all 3 tested only on a Windows system). Always, viewing a page shows most of the content, and then the browser prompts to download some sidebar ...
1
vote
2answers
1k views

How to remove blank lines in .txt files

I want to change a text file's format, removing all blank lines. How can I do that? (2) 5. The function of the condenser is to: a) vapourise the liquid refrigerant b) change ...
1
vote
1answer
2k views

How do I write an AutoHotKey script to search and replace a clipboard string when an item is copied to the clipboard?

I'd like to create an AutoHotKey script such that when a string item is copied to the clipboard, a search and replace is done on the string, and the resulting string be copied to the clipboard. ...
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
2answers
3k 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
1k views

Need to truncate the %username% variable in windows 7 to seven characters

I use a script that generates a session name for out AS400 sessions based on the system %username%, the problem is that if the username is over 7 characters long the connection will fail. The session ...
3
votes
4answers
2k views

Change shortcut targets in bulk?

I have hundreds of shortcuts to websites where the target looks like this: C:\Users\Herb\AppData\Local\Google\Chrome\Application\chrome.exe www.somesite.com/foo I just upgraded to Windows 8, and ...
3
votes
1answer
811 views

Automate BTWiFi login using a FON account

I'm a user of British Telecom's Wifi hotspot. The service is good, but after some time of inactivity it logs me off and asks for user name and password. It's really annoying in the long run. Did ...
3
votes
2answers
2k views

Run a script at logoff on XP Home?

Is this possible without having a process running continuously, listening for WM_QUERYENDSESSION or similar? (or worse still, loading a DLL into the Winlogon process) (Also unacceptable: write a ...
2
votes
2answers
13k views

Automate mouse button click with script or macro

I'm searching for a script or macro program which pushes the 4th or 5th mouse button every 5 seconds. This script or macro program is for a friend who uses Windows 7 on an Asus notebook. I cannot try ...
1
vote
1answer
1k views

Remove all user folders except one on reboot

On a Mac, how can I create a script to automatically remove all user profile folders except a specific one on a reboot?