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)

0
votes
0answers
21 views

Windows batch file deletes and recopies files WAY too fast - should take 15+ seconds, takes < 1 second. Why?

I wrote a script that checks to see if a folder exists, and if so, empties it. it then waits 5 seconds, then proceeds to recopy new (or maybe the same) files back into the folder. When the folders ...
0
votes
1answer
22 views

How to create batch script to keep rerunning command

I just downloaded Win 10 and I'm having activation issues. I hear if I keep rerunning this - "slmgr.vbs /ato" command it will eventually activate. Can someone give me a quick little script to have ...
0
votes
0answers
10 views

Serial connection over PuTTY and -m?

I am using a com port to connect to a device. I would like to run a script that does 3 commands for me. Currently I'm trying to do "start putty.exe -load temp1 -m script.txt" All of that is in the ...
0
votes
0answers
11 views

Batch copy files from client list to my server

Could you help me to create batch file to get information from client to server. I have 10 clients such as 1. CU01 2. CU02 3. CU03 . . . 10.CU10 I would like to copy file from 10 clients on ...
0
votes
3answers
37 views

Is there a way to run Javascript without a browser, like a shell or batch script?

Is there a way one could run Javascript the way Python, Bash, Windows Batch or other scripting languages are run? File access and other library functions would be nice but are not required - I'm just ...
0
votes
0answers
12 views

How to get file path of selected file in Finder into clipboard? Issue with Jumpcut

I used to be able to get the file path from any selected file in Finder by hitting a keyboard shortcut. I'm running an automated script that takes Files and Folders in Finder and uses the built-in ...
0
votes
2answers
17 views

Continuously check status of OpenVPN connection

I'm trying to check and display the status (connected/not connected) and the server's hostname/cn of an OpenVPN connection that should connect at every boot. Now I've found out that in ...
0
votes
0answers
28 views

PowerShell script to monitor files in multiple folders

Can anyone help me with the PowerShell script below to monitor files in multiple folders (like D:\test1 and D:\test2 and D:\Test3)? SET FOLDER TO WATCH + FILES TO WATCH + SUBFOLDERS YES/NO $watcher = ...
0
votes
2answers
19 views

Command host with awk

Please, why "echo" instruction: iphost="$(ssh root@$machine -x "host $machine | awk '/has address/ { print $4 }'")" echo $iphost display: g-3.xx.yyy.zz has address 172.16.65.35 instead of: ...
0
votes
2answers
41 views

How can i get the hostname of the machine i work on?

Please, how can i get the hostname (fully qualified domain name) of the machine i work on ? Here is my script: #! /bin/sh hostname=$(host $ipaddr | awk '{print substr($NF,1,length($NF)-1)}') ...
0
votes
1answer
16 views

Script Shell Storing ip address in a table

Here is my file: test.txt 172.16.65.29 172.16.65.30 Please, how can i modify this script to store all ip address in test.txt in a table. for ip in ${iparr[@]} do echo $ip done Thank you so much ...
-3
votes
1answer
24 views

How to get started with shell scripting? [closed]

My job profile requires a certain level of shell scripting and I have no idea on how would i get started with it Please suggest me with the easy ways to getting started with shell scripting. Thank ...
0
votes
0answers
15 views

Perl script to parse log file [migrated]

I want to parse my flexlm license.log file and archiving below information into another .csv file: Date Time stamp Licence checkout / checkin Feature name User name Machine The log file format is ...
0
votes
0answers
19 views

setup vim script to execute python file

I searched SO extensively and I can't get to fix this: I'm trying to code a pathogen friendly python plugin in windows. The setup would be: In \vimfiles\bundle\plugin I have a myscript.vim with: ...
2
votes
0answers
22 views

Logon and Logoff scripts not running

I have set SQL queries to run on logon and logoff using group policy editor. But sometimes scripts do not run. logon.bat @echo off echo INSERT INTO UPTIME(INTIME) VALUES(NOW()); > abc.sql mysql ...
0
votes
1answer
30 views

How to upload all the files from local to host using Curl?

i have written a shell script to upload all files with different names in the specific path from local to host, but i have facing some issue and the files are not getting uploaded #!/bin/sh for file ...
1
vote
1answer
34 views

file names starting with a string in the format of *.txt give error in FOR

I have a piece in my windows batch script. It runs fine as : for /f %%C in ('Find /V /C "" ^< %SFTP_INDIR%\Location.20150528060210.txt') do set count=%%C But when run instead of a hardcoded ...
0
votes
2answers
32 views

How can I break a batch script that is executing a ping without terminating the whole script?

I have a batch script that continuously pings an address and I want a way to cancel the pinging but not terminate the whole script (alternative to ctrl^C).
0
votes
1answer
38 views

PowerShell - Quasi equivalent strings are infact not equivalent?

I have a string which I'm passing into my script as an argument. For the purpose of displaying the code on here however, I have specified these manually in the code. These variables are: ...
1
vote
2answers
27 views

Powershell: Dir /s - Remove Repeated Folders

Situation: In Powershell, I'm using: $folders = dir -s C:\Users\Name\Downloads\*.ttf | Select Directory foreach ($folder in $folders) { echo $folder } To display folders whose contents ...
0
votes
1answer
37 views

Rotate all video in a folder with ffmpeg?

I have a lot of videos which are recorder 90 • rotated so I want to rotate all videos 90 degrees clockwise direction. If this possible? I used for loop but there is some mistake because of spaces ...
1
vote
0answers
22 views

Auto Accept Twitter Followers Requests [migrated]

I have more than 2000 follower requests. I want to approve them all. I thought the API would help, but apparently not. Is there some way to Auto Accept all follower requests with any script or ...
1
vote
2answers
24 views

How to hide all files in a folder via using terminal or script

I have a folder which located as /home/makgun/Desktop/a\ b so that I tried this command mv /home/makgun/Desktop/a\ b/* /home/makgun/Desktop/a\ b/.* to rename all files as .FILENAME to be hidden but ...
0
votes
0answers
22 views

Python/Powershell Script for Telnet

I'm most familiar with powershell and python so a solution which utilized either of them would be ideal. I'm also open to other ideas on resolving this issue. So I have a situation where an old ...
2
votes
2answers
30 views

Running bash scripts from bash script in other folder

I've got several folders (one for each month), each with a bash script savetodatabase.sh. I want to run all of them after each other, so I made a script named saveall.sh which has the following code: ...
1
vote
1answer
35 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 ...
0
votes
1answer
29 views

Script Shell Find each occurrence of a String in a file

Here is the structure of my file: /**** Some Text here ****/ DN 10.147.243.93 51.46 KB 256 34.2% DN 10.147.243.89 83.05 KB 256 34.6% DN 10.147.243.88 66.43 ...
0
votes
1answer
30 views

Concat String with variable after a 'grep'

Here is the structure of my file: g-4.n.g.fr 10.147.243.63 g-4.n.g.fr-w1 Here is my sript: #! /bin/sh ip=10.147.243.63 worker=$(grep -e $ip $1 | awk '{ print $3; }') echo "[Hostname: ]" echo ...
2
votes
3answers
82 views

difference between ${} and $() in shell script

$ echo $(date) Thu Jul 2 16:33:11 SGT 2015 $ echo ${date} $ name=foo $ echo $(name) ksh: name: not found $ echo ${name} foo Seems like ${variable} is the same as $variable. while $() is to ...
0
votes
0answers
7 views

How can uptime be used to trigger a email if it see it does not contain days.

I took this from another thread I found here so that being said. I am new to scripting and it would be helpful if you could tell me how one would accomplish the following. I use pdsh so the first line ...
2
votes
1answer
23 views

run runas in a shell

I'm playing with a Windows 7 VM that I own. I started a reverse shell with ncat as listener. I can run commands except runas. Whenever I try to switch to another user I got prompted for the password ...
0
votes
1answer
39 views

Script Shell Find a String in a file

Here is the structure of my file: /**** Some Text here ****/ UN 10.147.243.93 51.46 KB 256 34.2% UN 10.147.243.89 83.05 KB 256 34.6% DN 10.147.243.88 66.43 ...
1
vote
2answers
57 views

Running a Python script from the “Run” prompt

I thought this would be easy, but I've been struggling for a while. I have a Python script on my Windows machine called "myscript.py". I have it in a folder that's on my PATH, and I've added the ...
0
votes
3answers
50 views

How to append multiple .txt files to one file without header line

I have 100,000 .txt files with format below: bygrp,colnum,beta 100005,1,0.629519434191718 100005,2,-0.500000000026516 100005,3,0.560850895321124 100005,4,0.119624318119292 100005,5,0.257676682753309 ...
0
votes
0answers
11 views

Tracking changes of a file

Please, i'd like to know if there is a solution (command linux for example) to track changes in a file. UN: up ; DN: down Here is my file before changes: UN 10.147.243.93 51.46 KB 256 34.2% ...
0
votes
1answer
28 views

Result of | grep in a variable

Here is my script: var= $( $line | grep -Po '.*(?=.fr)' ) echo $var I have an error and it displays nothing: command not found Have you idea please ? Thank you so much for help. Best ...
1
vote
1answer
23 views

Windows: Run script on cd

On linux, I've got a number of scripts running upon changing to a directory. Tasks like updating repos, rotating logs, etc, are decided through a small bash script that overrides bash's "cd" and runs ...
0
votes
1answer
65 views

Most favorite scripting language used by IT pros [closed]

What is the most favorite scripting languages used by IT pros and why? I see that Javascript is mostly used by developers while legacy VBScript and Powershell for Windows admins and bash/shell for ...
2
votes
1answer
20 views

PowerShell get TotalPhysicalMemory (RAM) without decimals

I'm writing a powershell script to inventory some info about computers (CPU, RAM, HDD, etc...). Everything is working quite well, but I'm stuck at getting the right output for the amount of RAM. Here ...
0
votes
0answers
37 views

Shell Script “cannot execute binary file”

I'm new to putty. However while running a shell script I got this error: "cannot execute binary file" I believed the syntax is : sh Name_of_shellScript.sh parameters How can I resolve this?
0
votes
0answers
76 views

OpenVPN --up script - “could not execute external program”

After a few days on Google, i'm not able to find the right answer to my question. After reading a lot of scripting possibilities, then OpenVPN is up. I have a client running Debian 7.8, with OpenVPN ...
1
vote
1answer
27 views

Script/program that listens for user input, reads logs for output and sends broadcast

During code deployments there is a risk of service/system failures. The Network Operations Center monitors alerts from servers. If the alert comes as a result of a code deployment then it might not be ...
0
votes
0answers
12 views

Replace numbered paragraphs from one document to another?

I have two documents that are identical, but one is in English, the other in Spanish. I took the first and took care of reformatting it by hand, mostly. Now, rather than going through the lengthy ...
0
votes
1answer
75 views

How can i kill a process remotely?

I use this command to kill remotely a process but it didn't work. ssh -t root@g-9 -x "sshpass -p 'ubuntu' ssh -t root@10.147.243.178 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -x ...
0
votes
0answers
15 views

How to change taskbar location via script when monitor is detected

I have a second monitor that I sometimes use, and would like to have windows move the taskbar to it whenever it detects the monitor - is there a way to script it to do such a thing? I believe I can ...
0
votes
1answer
13 views

Vimperator — Custom ExtendedHit to launch script/program on matching regex

I want to define a custom extendedhint in vimperator that: Matches a regex pattern Feeds that match to a script as such: ~/bin/script regex-match-as-arg Where should I start solving this problem? ...
-1
votes
2answers
31 views

Only show part of logfile in bash script

OpenVPN log looks like this: OpenVPN CLIENT LIST Updated,Sat Jun 20 04:20:07 2015 Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since [ A .... ] ROUTING TABLE Virtual Address,Common ...
0
votes
2answers
68 views

Windows 7 logoff script?

I've been trying this for a while, to no avail. I read many docs, including: Windows 7 - How to run a script at shutdown but not at logoff https://technet.microsoft.com/en-us/library/cc770300.aspx ...
0
votes
1answer
32 views

How to do this in all subdirectories in parent folder using batch script?

i am total noob for scripting so i need small help with this batch script... Here is script : @ECHO OFF SetLocal EnableDelayedExpansion SET par2_path="C:\PAR2\phpar2.exe" SET par2_redundancy=10 ...
1
vote
1answer
20 views

Monitor SSH login's via slack but hangs on SCP

I'm playing around with some slack integration so that every SSH attempt gets sent to a slack channel The script below works perfectly for SSH attempts but the issue is that when I preform a SCP to ...