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
2answers
35 views

Nesting IF in Windows Bat file

I am having some difficulty in understanding how the Nested IF works in windows .bat script. What I wish to achieve is as follows. I shall be passing two parameters to a bat file IF first parameter = ...
4
votes
1answer
102 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: ...
0
votes
0answers
67 views

Google Script to Copy Rows Containing Todays Date To Another Sheet

I have the following script that works just fine, except i now need it to copy all rows in "Dashboard" column A that has that has "today's" date (current date), beginning in row 13. Note, the ...
0
votes
1answer
17 views

Script Shell Division Operation

Here is my script: #!/bin/bash nb_lines=30 expr 100 / $nb_lines ./test1.sh 3 1) How can i change this script to have '3.33333333' ? Variable 1 2) How can i change this script to have '4' (round ...
3
votes
3answers
158 views

How to detect DVD drive letter via BATCH file in MS WIndows 7?

How to detect DVD drive letter via BATCH file in MS WIndows 7? I mean, I need to know that DVD could have assigned letter D or E... Is there any script to do it?
0
votes
0answers
12 views

Logrotate - leave file with some content

im looking for a tool or script which logrotates a folder of log files, but leaves some lines in the logs for ex. it cuts all lines older than 2 days and writes them into another file. are there any ...
0
votes
1answer
56 views

Shutdown a linux computer depending on the battery level

Is there a way to shutdown a linux-based computer when the battery charge drops below a certain level? I have searched through the shutdown and poweroff manuals but found nothing relevant.
0
votes
1answer
14 views

Script Shell Extract String In the middle

#! /bin/sh lineversion ="/tmp/g-9.n.gggg1000.fr-worker1.V.2.tar.bz2" My question: how can i extract g-9.n.gggg1000.fr from $lineversion in another variable
-3
votes
1answer
104 views

Disable/Enable secure logon on windows 7 via commandline

In windows you can disable the usage of ctrl+alt+delete before logging in. {Via netplwiz or user controlpasswords2 then advanced will give you a window with at the bottom of it this option}. Is there ...
1
vote
0answers
15 views

Starting Scripts Using SSH

Case 1: ./Myscript.sh param (on a first node) Another node: (In parallel i run the same script) ./Myscript.sh param (on a second node) Case2: From my host, using ssh: for i in $(seq $...
1
vote
1answer
39 views

Do Until in Powershell

I'm connecting via serial port with powershell to a device and I'm trying to change one value until another value gets to 0. I'm using Do-Until but it just runs endlessly with the first value being ...
0
votes
0answers
28 views

Shell script using diff to compare the different files

I have five different files and all are in different directory, I want to check matching files and find out the unique files as well. I am not sure how should I handle this.
0
votes
0answers
52 views

Set specific User's account picture via Batch script

Background: Our company is a small MSP. I have written a script that works well to create our local admin account and set us as a local administrator. That part isn't super important. The main thing ...
1
vote
0answers
88 views

Firefox “do not ask me again” option for unresponsive scripts isn't working - what can I do?

Firefox keeps asking me if I want to stop unresponsive scripts when it encounters them. This happens a lot with my Gmail inbox after it has been left open for some time, however it happens on other ...
1
vote
1answer
18 views

Check hash and then do a certain function

I am trying to check a hash (doesn't matter which), and if a certain hash is met, then run certain commands. Currently my code is if [[ md5sum $file -ne $sum ]] then $commands fi However, ...
0
votes
0answers
102 views

How to run logon script for RDP users

I have a very simple login script ( login.bat ) containing the following line: start chrome I want the logon script to run for any user who logs in via RDP. I've set the script as a so called ...
0
votes
1answer
25 views

Text moves more to the right when looping

This is my output below when creating a function with a for loop inside it: NO Type -- ---- 1 System.Int32 2 System.Int32 3 System.Int32 4 System.Int32 5 ...
0
votes
2answers
26 views

Script Shell Extract String

#! /bin/sh lineversion ="/tmp/g-9.n.gggg1000.fr-worker1.V.2.tar.bz2" My question: how can i extract g-9.n.gggg1000.fr-worker1.V.2 from $lineversion in another variable
0
votes
2answers
20 views

KShell script skips commands when scheduled in cron

I have a Kshell script which executes a java program. /path/to/java -jar jarfile.jar some parameters > log Same line 5 times with different parameters appending output to log file. cat log | mail -...
1
vote
1answer
43 views

Toggle network share on Windows 7

I need help with mounting a samba share with a shortcut/button. I want to be able to mount a share and unmount it with the same button. Here is the pseudo code i had in mind. Requirements are simple: ...
0
votes
1answer
42 views

how to write a shell script to take password automattically after the execution of command

#!/bin/bash cd /var/SUNWdsee/ds6/bin ./dsconf show-repl-agmt-status -e suffix Hostname:389 Above is my script. After the execution of the last line it will prompt for password in screen. I need to ...
-3
votes
1answer
22 views

Clicking link in Chrome without it opening

It seems that many websites nowadays have some code, that when you first open the site and click anywhere on it, it opens a new tab, usually with some kind of advertisement which you manually have to ...
0
votes
0answers
10 views

Parse text from iTunes

I need to find a way to parse some text from an OS X app, specifically iTunes. What I need to do is go to an Application's page and parse the reviews from it. I know there may be better ways, but the ...
0
votes
2answers
41 views

How can I delete rest of the line after a second the same specific character on string?

dagaga2.com:8ddagd1:dbcc:eLXLBdRdd?a'badagahaha dadadagh.com:299515:dgan6hhna:992969199269196 dad2agh.com:299515:dganhna:992969199269196 dadada5uwuwgh.com:299ju515:dgaenhna:9929691998d269196 ...
1
vote
1answer
71 views

Adding date to the name of multiple files in multiple folders

I have a directory which contains 400+ subfolders. In each of this subfolders a new file appears every day. Each new file has the same name as the file that appeared in the same folder yesterday. Each ...
0
votes
0answers
11 views

cronjob not finding commands [duplicate]

I am running (and also new to) OS X El Capitan. I have a user cronjob that is using some basic commands that I got via brew. wget and s3cmd I have the cronjob executing a shel script in my user bin, ...
1
vote
0answers
48 views

inotify does run twice

I wanted to write a script that triggers some code when a file gets changed (meaning the content changes or the file gets overwritten by file with the same name) in a specific directory (or in a ...
0
votes
0answers
71 views

Need help building a shutdown task

I'm running Windows 7 Pro and need help writing a vbscript/wscript that, upon the user trying to shut down the computer, will check a specific directory for .xml files. If files exist, it will run a ....
1
vote
1answer
41 views

Linux - create screen as another user

I'm trying to create a new screen on my server (CentOS 5.11), but instead of starting it with my user, I would prefer to use another user with restricted permissions, just to be on the safe side. So, ...
0
votes
0answers
19 views

need a ping script.sh that checks pingable ip's on lan and stops at last “alive”

I have a bash script on my Debian 8 32 bit that checks what devices are pingable. simple script name"checkip.sh #!/bin/bash fping -g 192.168.1.1 192.168.1.50 The problem is it continues to check ...
0
votes
0answers
24 views

Check which user changed which file with inotifywait

I would like to write a script which uploads a file to ownCloud (through the user that changed the file) if it was changed (written over or changed content) in a specific directory. I figured I would ...
1
vote
2answers
218 views

Script to merge a specific line of multiple .txt files into one .txt file

I have ~800 .txt files. I need extract the name of each file, and one line inside the file, and export it to a new .txt file. The line I need to copy will always start with "System Boot Time:" I'd ...
0
votes
1answer
47 views

restart bash script on exit(1) from php script?

I have a php script that works as long as the internet is on. When problems occur, it exits with code 1. the code in windows looks like this: :start php myScript.php IF %ERRORLEVEL% NEQ 0( ECHO "...
0
votes
1answer
104 views

How to run determine current directory as parameter and pass to script activated from context menu

not sure the title is entirely adequate so let me explain a little clearer. I have an existing powershell script which deletes backups of specific file types. What I want to be able to do is right ...
0
votes
0answers
21 views

Removing “Network Device” which was manually added via script

I have a site on GoDaddy which uses the cpanel software as part of the hosting service. I downloaded their visual basic script to connect to a "Web disk" but now I want it removed. Anyone know how I ...
0
votes
1answer
32 views

Restarting an application upon its closing

I'd like to turn some Windows (7, 8, 10) PCs into indie arcade setups for an event. I really want it to be fool proof. Plugging in controllers and launching a game is easy enough, but games have exit ...
0
votes
0answers
20 views

How to close a program when connecting to a specific wifi on Windows

I have a small download limit on my home wifi. Everytime I open my laptop dropbox starts and starts syncing consuming my download limit. I don't want to remove dropbox from my automatic startup list ...
1
vote
1answer
79 views

How to set one password for all net users in cmd for batch script?

Im writing a windows batch script and I need to set all the users to a certain password? I know that I can do net user to see all users on the computer and I can do net user username password to set ...
0
votes
1answer
124 views

Cant get Windows Script File to close after Telnet

Below is the Current Script I have for my current little project. <job> <script language="VBScript"> Option Explicit On Error Resume Next Dim WshShell set WshShell=...
1
vote
1answer
104 views

How do I change the folder this script saves a downloaded video to?

I'm using HotStarLiveStreamer https://github.com/biezom/hotstarsportslivestreamer and I'm having trouble understanding how I can modify the .bat file script to suit my purposes. @ echo off call ...
0
votes
0answers
16 views

Stop bash script with any key

I'm writing a script which I want to stop with any key I choose. After pressing the key, my intention is to complete all my commands at that moment and start su. I've tried adding a & to my ...
0
votes
1answer
260 views

Scripting parallel FTP downloads (multiple connections) on Windows

I need a scripting solution to download several (more then 100) websites by FTP for backup purposes. For each website I want a scripting solution which supports 10 parallel connections to only one ...
0
votes
0answers
85 views

FFmpeg script to convert all WebM files in a folder to Gif, and then delete the WebM files

I'm using FFmpeg with DirectoryMonitor, a folder watching program. When a webm is added to the folder i want to execute a script to convert all webm files in that folder to gif, and then delete those ...
0
votes
1answer
59 views

How to overwrite an echo/printf line with another one? (Making it start at the center of the screen)

I want to write a script which outputs sentences I choose. I want them to appear in the center of the screen: output the first one, and then make the second one appear over the first. Here's my code: ...
0
votes
1answer
21 views

Apple Script: cannot call id3tag from script with “do shell script”

Trying to rename mp3s from an apple script which will be part of a larger script including Audio Hijacker. set folder_p to "/Users/me/Music/" set folder_path to POSIX path of folder_p set file_path ...
0
votes
0answers
23 views

Script in for ffmpeg import-export macro that changes text lines

Was pointed here from video network for the question. I was thinking setting up list of files from folder in excel, all with .mp4. Around 4000 lines in total. Column A - original file name Column ...
1
vote
1answer
201 views

Send E-Mail from Powershell Script to Multiple Recipients based on ActiveDirectory User

I have a script that I would like to dynamically send an email containing some info and go to certain people based on who in the company is running the script thanks to ActiveDirectory. I have ...
0
votes
0answers
69 views

Soft Link/Hard Link Script for OneDrive

My problem is the following: I had redirected all my Users/Documents, /Pictures, /Videos, /Music folders to another Drive, but also merged them with my relocated OneDrive. Everything was fine and all ...
1
vote
2answers
150 views

What is the maximum value of a numeric bash shell variable?

I'm curious as to what happens when a numeric variable in bash is incremented up without purposely stopping it. How large can the number get? Will it overflow and become negative and just continue to ...
0
votes
2answers
51 views

Running a script when I exit a program

I want to identify when a specific program is being shut down, and run a script when it does. Is there a way to do that on Windows? The thing I had in mind is running automated git commit + push ...