0
votes
0answers
26 views

Trap a program that has no command line output

I am using the CrashPlan backup tool to backup my home file server. I use an ssh tunnel to interact with the GUI on the remote machine (as detailed here). Currently, I have an alias in my zshrc that ...
0
votes
0answers
3 views

mac os x wireless association to wpa2-enterprise SSID from the command line

I have a script that connects to a bunch of macbook laptops and makes them associate to a certain SSID. The command that I run is networksetup -setairportnetwork en0 SSID PASSWORD. However If I have a ...
0
votes
1answer
22 views

Alter default audio output device from command-line

I have 2 audio output devices: 5.1 Speaker System attached via Toslink Gaming Headset attached via USB Is there a simple way to change which device is the default output device, from the ...
1
vote
3answers
69 views

Windows command line

I have an exe which produces an output with some parameter, and from that output I want the integer portion to be stored in a file like below: C:\MyExe -param gives an o/p 123abc, so 123 should be ...
1
vote
2answers
83 views

BAT file: Delete all files in directory older than 5 days except one file

I have a directory with many temp files. All files older than 5 days can be deleted except one file 'DoNotDelete.txt'. Therefore I should add an extra argument to my current script: forfiles /p ...
0
votes
2answers
29 views

Perform scp-then-ssh in one connection

Both at work and at home I tend to do the following very often: $ scp "SomeScriptIJustCreatedOrModified.sh" some-server: $ ssh some-server ./SomeScriptIJustCreatedOrModified.sh arguments And ...
0
votes
1answer
78 views

Batch Script to Trim lines in text to first 30 or 50 characters only

I am now new to scripts but i find it really difficult understanding "for" command (especially with that tokens and delimiters etc) . Saying so, i think that for command can be used to do what i am ...
1
vote
1answer
55 views

How can I move files into a folder based on their name?

I have several .pdf and .tex-files in a certain folder "ABC". They all are named by the scheme C01S02_Word.pdf C03S02SS01_Description_random_words.pdf C04S01SS02_More_words.pdf and so forth C in ...
0
votes
0answers
14 views

How to hide cmd window of a Calibre Content Server batch script? [duplicate]

So I manage to be able to share more than one Server Content at the same time with the same PC. If someone want to know how can I do this, is easy. Make a batch script and put this: @echo off ...
0
votes
1answer
32 views

Command fails in a script?

I'm trying to script the OpenSSL ec command. The script is used to validate a collection of keys produced by another library. The script is shown below after the question. The following works from a ...
2
votes
1answer
169 views

Variable in WinSCP script

I'm asked to automate some SFTP download processes via WinSCP. I'm not familiar with WinSCP scripting. ftprun.cmd: C:\Program Files\WinSCP\winscp.com" /script=D:\testsftp\ftpscript.txt ...
0
votes
0answers
79 views

How to run adb command through a script

As the title says, I'm trying to find how to run adb commands through a pre-written script (such as how .bat and .vbs files work) so I can make a semi automatic program to pull some files from my ...
0
votes
1answer
47 views

How to use find to fill in variable in Shell script

I am making simple Shell script form some boring-ever-repeating job. Script changes directory correctly, and now I want to run other scripts based on argument I typed when running script. Other ...
0
votes
0answers
28 views

Combining a bunch of find commands into one command or script.

I was wondering how to combine a bunch of find commands into one. This is the list of find commands I want to run and in the order. find /path/to/folder/ -name '*Sample*' -exec rm -rf {} \; find ...
0
votes
1answer
82 views

Cannot unzip with zip command line

I am having difficult unpacking a zip to a specific directory. I am trying to get all contents of subdirectory of the zipped file and not the parent directory. This is parent directory within zip ...
0
votes
1answer
50 views

Getopts - command with multiple options

I have a command script i'm making and wondering how do i go about combining multiple options the general usage of the command is as follows: Usage: myCommand [-fpr] [-n count] [-s size] [-u user] ...
1
vote
0answers
54 views

Creating multiple screens in a for loop to run parellel programs and sending commands to each

Before flagging this questions as redundant, i have read and tried every answer to similar questions with no success I have this loop where it traverses a directory structure, and runs a program ...
0
votes
0answers
51 views

Batch Files - Script

I have a little .cmd script that executes few commands like mapping network drive, output some info to log file and copy the file on network including renaming the title based on date/time. This ...
0
votes
1answer
89 views

ControlC doesn't stop .cmd script in Windows7 CMD window

I work with several Windows7-64 systems. In all but one, typing ^C into a CMD window running a .cmd file, invariably (and expectedly) stops the program. More importantly, if the .cmd script launched ...
3
votes
1answer
254 views

#!/bin/bash -e :: what is `-e`? other arguments?

I am a shell script coder that always opt to use shell as top level as part of my belt in creating website apps on the fly and have relied on my bash scripts if I want a project to be implemented ...
1
vote
1answer
40 views

Launch Script for Windows7

Hey guys hopefully I can thoroughly explain what I'm trying to do here! LOL I have a dual display Windows 7 PC and what I am trying to do is launch 2 different programs on boot, and I want one to ...
0
votes
0answers
6 views

open perfmon with custom category with predefined field

I'd like to add some .bat file to my installation, that once pressed will open Performance Counters with my subsystem counters In Report View Is that possible from command line?
2
votes
2answers
59 views

quotes around filenames confuse bash script

I am writing a script that applies a command to loads of files. The way I automate this boils down to #!/bin bash for in_file in ${PWD}/*/*/*.txt; do out_file="${in_file//in/out}" ...
0
votes
0answers
78 views

Powershell not exiting when called from Orchestrator

I'm trying to run a powershell script from orchestrator. The script works fine from my interactive prompt but when run from a orchestrator runbook it never exits and the overall runbook appears to be ...
0
votes
1answer
17 views

automatically launch/open a file when it changes

OS: OS X Lion Shell: zsh I'd like to automatically launch/open a file when it changes. Background: i'm working on a windows vm, generating pdfs. Syncing via dropbox and when a file changes on ...
0
votes
1answer
439 views

Batch to prompt for folder name and command, redirect to TXT file

What I'm trying to accomplish, is to have the batch file prompt the user to input their specific folder on our team's directory, and then prompt for a specific command to be used, and redirected to a ...
1
vote
0answers
211 views

How can I modify the BAT file in this post so it will randomly select 1 background contained in a folder containing multiple backgrounds?

Is there a way to modify the bat file from this post here: How do I set the desktop background on Windows from a script? so that it will randomly select 1 background image from a folder containing ...
1
vote
1answer
272 views

What is the easiest way to turn a list of music files into a playlist

I recently switched from windows to linux and the player I was using in windows stored the rating for flac files inside an id3v2 files which clementine, my preferred linux media player, cannot read. ...
1
vote
4answers
1k views

Linux: Run command on a batch of files, with matching output files

A simple task: given a directory of files and a command that takes one file as input and produces one file as output, I want to process all the files in a directory at once and output them with ...
0
votes
0answers
112 views

Raspberry Pi, how to execute program as a SU and stop loop in bootup

I have a script python.py and wish to execute the program after the boot-up sequence, one problem is it needs SU access in order to have the write function inside the program. Without the SU, the ...
-2
votes
1answer
93 views

how to write a script that opens cmd and runs a command? [closed]

I would like to write a script that opens the cmd and runs some command that I wrote. How can I do it? and when I save the file - the ending is .txt? i'm not familiar with it so any help would be ...
2
votes
2answers
645 views

How do I obtain Windows command line report of total committed memory (commit charge)?

I want to have a small batch script which runs on a server and every hour logs memory statistics. I already have the script log the process-specific info I want via other tools, but I want to know of ...
0
votes
1answer
221 views

sed command working in command line but not in script [closed]

I have a script with the follow code: find . -name "*.html" -print0 | while IFS= read -r -d '' n; do sed -i -r 's/<font ...
65
votes
6answers
4k views

How do I perform commands in another folder, without repeating the folder path?

Is there a clever way to do copy and move operations or a command to duplicate a file, without having to do a cd, then mv after, at the same folder? For example, I have to run the following: mv ...
0
votes
1answer
303 views

Writing a tcsh script to copy files specified in first argument to a specific directory

I'm trying to write a script in tcsh that will copy select files that I specify at the command line from one directory to another without having to write out the entire path of each file. Also, to ...
0
votes
2answers
278 views

Writing Unix script (bash) that creates a directory in the location specified at the command line

I currently have a Unix script (written in bash) that executes several commands to modify a group of files, which I specify with an flist containing their paths. The general idea of the script is to ...
1
vote
1answer
128 views

Unattended installation of a .pkg file in Haiku

Is there a way to do this from the command-line, additionally being able to specify the destination partition? I tried to create an empty partition, and install the package onto that, so I could just ...
1
vote
2answers
3k 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
165 views

NAS and the Command Prompt

I have a Seagate GoFlex NAS drive. I keep my iTunes folder there. Windows has a map from "\GOFLEX_HOME\GoFlex Home Public" to X: This all works fine. From Window's Explorer I can drag and drop files ...
-2
votes
2answers
2k views

Need to write a .bat file to select all the text on a webpage and paste the text into a new txt file

Below is what I have so far, which opens chrome, goes to the URL, then opens a new .txt file. I need to select all the text on the page, copy it, paste it into the BigData.txt file, then save the file ...
1
vote
1answer
119 views

I want to get only the Filename in Windows Command Prompt

I have a problem: I want to get the filename only from this path line in Command Prompt Here's my path: \\jktfile-01\lsmk\SRP\BankPelapor\201209\Instance\2882000-2012-09-30-BSMS26.xml What kind of ...
0
votes
2answers
2k views

Bat script using WMIC causing issues

I am trying to write a script to install the correct display driver. Long story short on newer systems when you add a dedicated card the onboard is no longer disabled so when I run this command: FOR ...
0
votes
1answer
106 views

Download best image or media from website on command line

I'd like a command line script, that when called with an URL, will download all images&media, or with suitable command line arguments, filter them. It is not as easy as doing a wget and grep, as ...
0
votes
1answer
208 views

run interactive program from Window CMD script

I have a CMD script to run on Windows. It does DEL, but the shell would ask "Are you sure?" How do I make the script answer 'YES', or better yet, just does a silent DEL ? Thanks
1
vote
1answer
2k views

Copying only newer files from one folder to another

I have 2 folders with files. These files are the product of some build process. The first folder is the outputs of previous build while the latter is the output of the current build. I would like to ...
2
votes
2answers
1k views

Script to prefix filename with folder

I am trying to find a script that will work in Windows and prefix all files in a folder with the containing folder name. For example, in the folder C:\FolderName1 there are 3 files: hello.jpg ...
2
votes
5answers
6k views

Running scripts from another directory

Quite often, the script I want to execute is not located in my current working directory and I don't really want to leave it. Is it a good practice to run scripts (BASH, Perl etc.) from another ...
1
vote
1answer
1k views

Copying the timestamp from one file to another (using PowerShell 2.0 on Windows-7)

On my Android phone, it was configured to save pictures to the Phone-memory. I wanted to free up some memory in the phone, and since I have a 16GB uSD card, I: 1) copied all the pictures to my ...
4
votes
1answer
22k 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 ...
2
votes
2answers
767 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 ...