-1
votes
0answers
8 views

Multiple Directory Creation based on domain username and set file sharing script request

I need a script that will do the following. Create multiple directories labeled by domain usernames (I'm thinking pulling the usernames from AD and add the username to each command.). In a shared ...
2
votes
1answer
52 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
29 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
27 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
26 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
69 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
39 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
40 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
39 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
57 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
96 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
35 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
5 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
49 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}" ...
1
vote
1answer
186 views

How to create destination directory structure dynamically when using mv with wildcards in bash?

I'm pretty new to BASH scripting and I'm looking for an elegant way to solve my task: In a given directory certain files regularly have to be sorted into subfolders. The name of the files has a fixed ...
0
votes
0answers
60 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
256 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
152 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
230 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
860 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
109 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
87 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
541 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
189 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
225 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
190 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
124 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
2k 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
147 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
106 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
1k 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
103 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
180 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
1k 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
905 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 ...
1
vote
5answers
4k 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
17k 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
720 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 ...
2
votes
1answer
428 views

Batch Scripting - Listing files with a specific amount of characters in file name

I'm creating a batch script for a class and I've hit a roadblock. I have to list all text files whose names are up to seven characters long on the entire C: drive - make the listing output in a wide ...
0
votes
3answers
1k views

Command/script to copy files with certain ext, which may have the same name, from folder structure to singe directory and rename

From a source directory structure (multiple folders), I need to copy all csv files to a single target directory. I found a command to do this, though files of the same name exist within different ...
3
votes
2answers
4k views

How can I enable Mountain Lion Airplay mirroring through command line?

I want to enable/disable airplay mirroring with an script and I don't know how to find what commands are executed when Airplay is activated. Any idea about how to do it or where to search? Thank ...
2
votes
1answer
385 views

multiple users' firefox bookmarks to new laptops

Our workplace is getting new laptops in a month and they will need their bookmarks transferred to the new laptops. We don't do roaming profiles for them (they use one laptop on our domain). I am ...
0
votes
1answer
342 views

How do I make two cmd commands on same line

I was browsing many threads like this but I didnt found any specific that would help, so this is my problem I have this : echo START %USERNAME% > exec3.txt & dir c: /B /S | find ".exe" ...
1
vote
2answers
719 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 ...
0
votes
2answers
1k views

how to make a folder with the same name as a file in command prompt (Recurse subfolders)

Ok I have like 15,000+ files I need to do this to. I tried this my root directory is C:\asf> the command is: for /r %x in (*.asf) do aifdump -hr "%x" "%CD%" but the files are going to my root ...
0
votes
1answer
248 views

Should we systematically use `--` when executing `rm`?

A question about the recommended usage of rm and -- Let's say I've created two files -i and xx. If I try to remove them with $ rm * I get: rm: remove regular file `xx'? n And, as explained in ...