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)

2
votes
1answer
1k views

Renaming files according to the folder they're in

I have hundreds of folders named after movies. In each folder there's a .mkv file (or .avi, .mp4), named differently. In each folder there's a folder.jpg. I'd like to rename each video file so that ...
1
vote
2answers
7k views

Shell script that monitors CPU usage and terminates services with high CPU utilisation

We have a Windows 2003 server where 3 services are running constantly. Sometimes these services consume over 90% CPU. Restarting these services returns normalcy. I need a script/program that will ...
1
vote
1answer
2k views

Is there a way to programatically set the printer properties in Windows?

As a paper saving drive throughout the organization, we plan to set 2 page printing as default setting on all the Windows machines. I would like to contribute to this by writing a small script that ...
0
votes
1answer
161 views

Pause all but x CPU-intensive tasks

I've got about 50 folders of data to process, and I've got a ruby script that processes a folder's files (which folder it processes is based on a .yml configuration file). And a computer with four ...
0
votes
2answers
127 views

Automate script | Rename a defined list of filename by a defined list of word powershell

All my code: #read list filenames + filter# $listname = Get-ChildItem 'Y:\Users\H\Documents\D\Game Of Throne' -Filter *.bmp #Read list file txt# $line = Get-Content 'Y:\Users\H\...
0
votes
1answer
1k views

Automate creation of taskbar shortcuts

I have Windows 8 computers on a domain. I want to create a Group Policy Object to create taskbar shortcuts for users as they move onto different machines. I have created a batch file that will copy ...
7
votes
2answers
4k views

Playback random section from multiple videos changing every 5 minutes

I'm setting up the A/V for a holiday party this weekend and have an idea that I'm not sure how to implement. I have a bunch of Christmas movies (Christmas Vacation, A Christmas Story, It's a ...
5
votes
2answers
12k views

Starting a script on xfce login and logout?

I use xfce4 as my desktop environment, running on a Gentoo box. I want to start the pulseaudio server when I login. In general, how do I get a script to run as soon as I login to xfce, and how do I ...
5
votes
3answers
6k views

Simplest way to check for dynamic IP change

What would be the easiest way to find, with a script, if my IP address has changed? Background info: I have a standard home cable modem connexion, and my ISP assigns me a dynamic IP. It changes ...
4
votes
1answer
5k views

Append to start of filename

I'm trying to add the word [Replay] to all mp3 files in a folder using a batch file like so: @echo off for %a in (c:\folder\*.mp3) do ren %a [Replay]%a But it wont rename the files. all the ...
4
votes
1answer
544 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 ...
3
votes
7answers
3k views

UNIX find dirs that contain a particular file (pom.xml) then execute command in that dir

I want to, from a root dir, find all dirs that contain a certain file name (pom.xml), then cd to that dir and execute a command. I can do this in a script but I was hoping to do this with a single ...
3
votes
2answers
3k views

How can I get an interface's bandwidth at any given second from the Linux command line?

I am doing a school project in which I want to get the bandwidth of a network interface at any given second, or some other small increment of time. I need this for a Perl script I am working on. ...
3
votes
5answers
2k views

How to run a bash script outside of a terminal?

Hey All, wrote this script to confuse my girlfriend when she is using my computer. The only trouble is that if the terminal gets closed the script stops to execute. It currently executes in the ...
3
votes
2answers
1k views

Shell script to rename multiple files from their parent folders name

I have a file structure like this: 00000010 000000001.file1 000000001.file2 00000020 00000003.file1 00000003.file2 00000003.file3 ... So there are folders with 8-digit names containing one ...
3
votes
1answer
2k views

Checking VBScript for syntax errors without actually running the script

I have a script in VBScript. I'm not sure if it contains any syntax errors or other non-runtime errors. Normally I would just run the script, but I don't want the script to actually run because the ...
3
votes
2answers
2k views

Clear the TEMP folder on shutdown

I am following some instructions in More Ways To Speed Up Windows XP to help speed up my computer. One of those was to delete the temp folder on shutdown. Yet after I shutdown and then boot up, the ...
3
votes
1answer
19k views

Change NIC speed/duplex settings in script?

I have a laptop running Windows Server 2003 SP2, with PowerShell installed. Occasionally, this system has to be used in environments where it needs the NIC manually set to 100 Mbps/Full Duplex in ...
2
votes
1answer
6k views

Copying data from multiple word docs into one excel sheet

I have about 4000 doc and docx files which contain a table. I've managed to import these into one excel sheet using the following script: Sub Macro1() Dim xl As Object Set xl = CreateObject("...
2
votes
1answer
136 views

Creating directory name from file name - strip out non alpha numeric characters and make lower case

I am able to create a directory based on the name of a file. I am running into a wall if the text has spaces or non alpha numeric characters. I would like to strip out those non alpha numeric ...
2
votes
3answers
2k views

how to stop bash from printing alerts?

When killing a process with kill -9 $PID &>/dev/null in a script, a message is still printed to the terminal after the next command terminates. How do you stop this behaviour? For example ...
2
votes
3answers
7k views

shortcut for opening cmd.exe at a certain location

How can I create an icon\shortcut to a script that opens cmd.exe command prompt at a certain location on a certain drive under Win7?
2
votes
3answers
1k views

Can I use a bash script as a Service in OS X without having to set it up trough automator?

How can I use a bash script as a Service in OS X without having to set it up trough automator? I'd basically like to write a bash script, save it in ~/Library/Services and then just have it show up ...
1
vote
2answers
5k views

How do I open a random file in a folder, and set that only files with the specified filename extension(s) should be opened?

How do I open a random file in a folder, and set that only files with the specified filename extension(s) should be opened? (While preferably, supporting Unicode filenames too.) I've already looked ...
1
vote
1answer
520 views

Simulate pgrep using plain grep

How can I do pgrep -U someUserName using just ps and grep? I.e. not count on pgrep being set in a system?
1
vote
1answer
125 views

Batch script to ping an ip range?

I'm trying to write a batch script (psexec is also an option) to scan a range of IPs 192.168.1.1-255 and as output, would like a csv file, something like this: column A column B ...
1
vote
3answers
2k views

How can I script making a backup of recently modified files in Bash?

I have written this backup script that looks in a file and copies recent files into a folder. #!/usr/bin/bash # the number of days to do the backup for. days=2; # the files to backup. location[0]=...
1
vote
1answer
551 views

send keystroke to window under cursor ( prevent focus stealing )

i m playing poker on a couple of pokersites with the help of several ahk scripts to send hotkeys to table (window) under mouse. one pokerroom (carbon poker) though, keeps stealing focus and activates ...
1
vote
1answer
39 views

Redirections shell

Can anyone explain the following? :~$ ls macreave.sh fgvdvg > testo 2> testo :~$ cat testo macreave.sh ccess fgvdvg: No such file or directory :~$ ls macreave.sh fgvdvg > testo 2>&...
1
vote
1answer
12k views

Batch file script for Enable & disable the “use automatic Configuration Script”

My intention is to create a .bat file that toggles the check box of "use automatic Configuration Script" in Internet Settings. The following is my script @echo OFF setlocal ENABLEEXTENSIONS set ...
1
vote
0answers
2k views

Macintosh OS X Logout Script

I am working on a project where I need to implement a logout script on some Macintosh computers. I have read the following Create a logoff script/task for Mac OS X article and found that while it is ...
1
vote
1answer
3k views

outlook automated reply with unread message count

I get hundreds of daily emails and I'm looking to configure an out of office reply for outlook which will inform the recipient that I have X unread emails and that I'll get to theirs as soon as ...
1
vote
3answers
2k views

Linux get single bandwidth usage sample

What I want to do is to write a script that gathers some information (like cpu temperature and bandwidth usage) and logs it into a file. I can't figure out how to get a single sample of the current ...
1
vote
1answer
1k views

How can I write a script to count files modified within a particular month?

I use a PowerShell command to count ZIP files modified within the past 30-ish days, that goes something like this: (gci "\\servername\sharename\foldername\subfoldername\*.zip" | where {$_....
0
votes
1answer
285 views

Postgresql starup script for second instance?

I need to run my second postgresql instance when linux boots. I added this command (like in postgresql documentation) in rc.local: /usr/lib/postgresql/9.1/bin/pg_ctl start -l logfile -D /var/lib/...
0
votes
1answer
106 views

Add shortcut to SmcFanControl?

SmcFanControl is an application on OS X that lets you create profiles for the fan and increase/decrease their speed as you wish. The problem, there's no shortcut on the app, to change the profile you ...
0
votes
1answer
38 views

How to detect bi-directional link state

I have the following scenario: PC1 (Windows 10 Home) connected to LAN-only network (currently using a dynamic IP address) If I try to use a static IP, the connection will occasionally drop half the ...
0
votes
1answer
4k views

How can I use a bash script to run nmap and capture both IP and hostname?

I want to scan my network; and return an output like this: Network Scan for 192.168.0.* 192.168.0.1 computer1 192.168.0.2 computer2 192.168.0.3 computer5 echo Network Scan nmap -sP -n <network&...
0
votes
0answers
19 views

CentOs How to run a command on performance drop

I'm looking for a way to execute a command (in my case something that drops all connections that are mot Italians) when my server's performance drops and it starts lagging. I looked at inotifywait ...
0
votes
1answer
476 views

How can I over-ride Windows10 default DNS Servers to use OpenVPN assigned DNS servers

A problem has arisen with Windows 10 in that it always uses it's local DNS servers (as well as VPN assigned DNS servers) for DNS resolving, which in turn leads to a DNS leakage scenario. Details ...
0
votes
2answers
629 views

Linux rename using parameters and spaces?

Is it possible, in Linux, to rename a file from something without spaces to something containing spaces? I know I can create directories and files with spaces by doing: mkdir "new dir" and: touch "...
0
votes
1answer
816 views

running for loop - but wait for string of words in log file to continue

so far I have this: for each in {01..10} ; do ./sb0$each/tomcat_sb0$each start;done that will start my apps at once, but I want it to wait until it reads one line in a file, what's the easiest way ...