Questions tagged [script]

An automated series of instructions carried out in a specific order, such as a Windows script created to launch a specific program on startup.

Filter by
Sorted by
Tagged with
0
votes
1answer
40 views

Problems with psexec accepteula when using psingfo

I made my first script which can get and show the running time of a PC in our network. first it copies the pstools folder to the pc i would like to check. It goes to pstools folder on my PC so i can ...
0
votes
1answer
40 views

Escaping Parenthesis within a file path Parameter in a batch script

I've created a batch script to do some basic file management for me. It's passed in either a directory or file path, along with a category. The program will then Copy the file to another directory of ...
1
vote
2answers
44 views

Insert output of curl command to a line number in a file

Working on a script to automate a few things. Been having and issue with running a sed command to inser the output of curl to a line number in a file I have tried multiple variations of the command ...
0
votes
0answers
20 views

Batch Zipping files - Win10 - Zip groups of files with same first part of file name [closed]

I am set on a project to collect multiple years worth of data (several thousand .pdf files per year) and group them together by company code, which is the first few characters, separated by a space. ...
0
votes
0answers
14 views

Generate ID3 tag from filename in EasyTAG and ID3-TagIT

I just installed EasyTAG and ID3-TagIT tools and tried to generate ID3 tag from filename of MP3's. However, although I have tried to use tag codes for both apps, I am not able to generate tag as shown ...
0
votes
0answers
20 views

use network credentials in Veeam script

i am trying to secure my backups against ransomware ( using different non domain passwords on the shares) , i use the below script with Veeam Backup & replication community version the script ...
1
vote
1answer
55 views

Will running a computer program perpetually damage my computer?

I've written a Node.JS script for a Twitter bot that I made recently. It sends a tweet to the Twitter API at the top of every hour. I plan on running this in my command prompt perpetually, but am ...
-2
votes
0answers
11 views

PowerShell script: Search folders for PDF based on User Input, Out-File to view PDF

I'm new to PowerShell so I need help!   I'm trying to build a script to search two different folders with large amounts of PDF files contained in them. I need to be able to search both folders for ...
0
votes
1answer
19 views

Killing a windows process based on running time with script

I would to make a script to killtask a windows process / processes(childs) that runs for more than 25 hours, so I can task schedule it to run every 2 days: if an application runs for more than 25h = ...
0
votes
0answers
19 views

How to automate restore of veeam backup

we are creating backups with veeam agent for windows. I would need to restore those backups in an automated fashion. is there any command line client, a way to script the restore process or something ...
0
votes
1answer
78 views

Add a variable to a batch process

I'm using ffmpeg to rip some video files. I am looking to rip each video to a size of about 500 MB. To achieve this, I need the option to enter the video bitrate I choose for each individual file. ...
2
votes
2answers
43 views

Is it possible to execute a script when a monitor is power on/off?

I would like to start / stop some applications when I power on / off my HDMI monitor. My computer is always on but some graphical applications are not needed when nobody can watch. It consumes more ...
0
votes
0answers
7 views

Adding additionnal commands to run in the case of an ACPI event

/etc/acpi/events/powerconf contains: event=button/power.* action=/etc/acpi/actions/power.sh I want to run some commands before and in addition to /etc/acpi/actions/power.sh Two solutions come in ...
0
votes
0answers
24 views

Automatic “place” column completion “on change” event

I`ve been struggling with this one for a while and I really didn't come up with a possible approach on it so if you have ideas, please help me. So, the problem is this one: I`m trying to solve the ...
0
votes
1answer
93 views

Need some guidance about AHK Text Loop Script

I'm a gamer and mainly play Roblox, I need to set up a script that will open the chatbox by pressing the slash key and then it will say explode all and then the enter key. I've already managed to come ...
0
votes
1answer
82 views

Need assistance with making a AHK Text spam script

I hope your all doing well! I'm a gamer with little to no knowledge about scripting, in a game I'm trying to make an auto hotkey script that will press the slash key first and then copy-paste the ...
0
votes
0answers
37 views

Windows10 home PS script run on logout and/or shutdown

I am trying to run a simple powershell script to turn off my office hue lights when I logoff/ shutdown my windows 10 home PC. I know Home isnt fully supported as shipped to complete this but ...
0
votes
1answer
60 views

How can I launch a named Linux screen which executes a script at launch automatically?

How can I launch a named Linux screen which executes a script at launch automatically? So I want to use screen with these 2 conditions. The screen session should be named The screen session should ...
-1
votes
0answers
9 views

Bulk edit date format in exported chats (.txt file) [migrated]

This is the chat file exported from an instgram .json file This is how I want to alter the date format to look like I am trying to edit the exported chat file in .txt format and change the format of ...
-2
votes
0answers
24 views

LInux Bash Script, how do made it ask and waits for an answer?

okay ask something from a scrip bash like : #!/bin/bash printf "who you are?" but how do you get the answer and processes to an a variable to use it? printf "hi $answer nice to meet you ! \nhow ...
0
votes
1answer
42 views

Detecting a change in a log file and launching a script when a change is detected

I'm trying to write some code (in batch/powershell) that will launch a batch script that I've made (with the help of some great people here) when a change is detected in a logfile, I've tried some ...
-1
votes
1answer
30 views

Run a script when a file is modified [duplicate]

I need a way to track updates/modifications to a file in real time and run a batch script when they take place, I have tried this to no avail, which may be due to it being open in the program that is ...
-1
votes
1answer
51 views

Tail a file for changes and run a script when a change is detected [duplicate]

I need a way to track updates/modifications to a file in real time and run a batch script when they take place, I have tried this to no avail, which may be due to it being open in the program that is ...
0
votes
0answers
31 views

Given a large set of IDs, how would one extract information from another tab-separated file both ID-related and closely related data

The ID file is formatted thus: A0A1H3TMV2 Z8X0S9 A0A2M6TTB8 A0A2Q5TOM7 A0A1U4MIN3 X9RTW0 The tab-separated file has the following format: Query ID Neighbor ID A0A1H3TMV2 A0A1H3TMX3 ...
0
votes
0answers
20 views

Printing the output of a running notepad.exe process

Suppose I have a running notepad.exe process on my Windows machine - how do I print it's current contents that a user has entered, into a PowerShell console?
0
votes
3answers
425 views

Trying to take the line from a logfile, remove some text, and put it into a new text file in a batch script

I am trying to take the last line from a logfile and remove some text from the beginning and end of it and put it into a new text file. I have minimal batch experience, any help is appreciated. last ...
0
votes
1answer
49 views

Looking for specific characters in the filename in a directory (powershell)

Trying to get a list of all USA Titles in the text file this is what i have : $Path = "f:\Test\ $Text = "(USA)" $Results = "C:\Temp\test.txt" clear Get-ChildItem $Path | Where-Object {$_.Name -...
0
votes
1answer
36 views

Check and replace file same name only

Example: Folder 1 has A to Z file name Folder 2 has only V to Z file name I want to move then replace file in Folder 2 only with same name from file in Folder 1. is there a cmd/script...etc to do ...
0
votes
0answers
17 views

Clever technique to have an application launched by a wscript script use the script's icon in the Windows taskbar

In the Windows taskbar, I have a couple applications (.exe files) that I launch via shortcuts to custom wscript js scripts. These scripts perform some pre- and post-processing for those applications. ...
0
votes
1answer
126 views

Powershell Get-Date

I am creating an object in a powershell script that gets today date in the following format. $TodaysDate=Get-Date -Format "MM-MMM" The result shows the month as both a numeric value as well as the ...
0
votes
0answers
21 views

Console app does not start at sys boot

I created a long time ago this script to startup a java app and it worked ok until now when I rewrite it to a console app. #!/bin/bash ### BEGIN INIT INFO # Provides: myapp # Required-...
0
votes
0answers
13 views

How can I disable Windows sounds from cmd? [duplicate]

I mean setting this: manage audio devices->Sounds tab->Sound Scheme->No Sounds. How can I do this from cmd? If it is not possible from cmd than what are the options to do it programmatically?
0
votes
0answers
24 views

sh script at boot cannot access user folders

1st of all, I'm kind of a newbie in linux and scripts. I have an issue with a sh script that runs when I boot Raspbian. The script needs to access the home folder. When I launch it from my session, ...
0
votes
1answer
51 views

Can't figure out how to run this script

I'm trying to run the following: % sudo hfsfuse --force -o noatime /dev/[DEVICE IDENTIFIER] /path/to/empty/folder I have a fusion drive on my iMac and I'm trying to access a folder called "Folder" in ...
0
votes
1answer
81 views

Parse lines written to standard out in “real time”

First, I having only been learning Powershell for about a week primarily adapting Linux scripts to run on my (more powerful) Windows machine. So, please be kind with the lingo. I am trying to write a ...
2
votes
1answer
112 views

What does 'x' mean in this line #!/bin/sh -x?

Could you explain what 'x' means in the shebang #!/bin/sh -x ? Does it necessary to put '-x' in this line?
0
votes
1answer
21 views

Using txt file to delete user that is not shown in the list in linux debian10

I have an updated list of user in a txt file called updatedlist.txt, inside the list is all the existing username with some username being deleted as no longer needed, I want to write a script that ...
0
votes
1answer
29 views

Use Powershell Script to Share Drives over Local Network

I find it convenient to share drives between my computers over my home network. I do this by right clicking on the drive and changing the advanced sharing "Share Permissions" to NETWORK. I am wanting ...
0
votes
1answer
69 views

How to run an AHK script on Windows startup when the script is associated with a text editor

I have an AutoHotkey script and it should be started each time on Windows startup. For this purpose, it is located in %AppData%\Microsoft\Windows\Start Menu\Programs\Startup. The problem is that my ...
0
votes
2answers
159 views

Convert dates to epoch value on multiple columns using AWK

A,B,C,D 1,30/07/2014,data_n/a,data_n/a 2,30/07/2014,22/02/2018,data_n/a 3,26/02/2015,22/12/2016,28/07/2017 I would like to convert all dates at once to epoch format. I am trying to get the following ...
0
votes
0answers
33 views

Script to login to Windows (Windows 10)

Here's some background: I'm currently working on a project where I use the Windows Task Scheduler (triggered by computer waking from sleep) to run a Python script that turns on my webcam and runs a ...
0
votes
1answer
89 views

Why do commands in Try/Catch sometimes need -ErrorAction Stop and sometimes not?

In the example below I want to catch the Error with -ErrorAction Stop. It worked perfectly in this case. try { Import-Module -ErrorAction Stop -Force nomodule.psm1 } catch { Write-Host -...
0
votes
0answers
21 views

How to use a file someway and tell host that “file's in use” via PowerShell script?

I try to write a PowerShell script that asks user to give a video and audio name like: $inputVideo = Read-Host "Video name" $inputAudio = Read-Host "Audio name" Then, before reading inputAudio, to ...
0
votes
0answers
44 views

macOs 10.15 Change network service order. networksetup -ordernetworkservices

Basically, I'm trying to create a script to change the network services order. I've been checking macOS KB, and checking the man page of networksetup and apparently I'd should to be able to ...
0
votes
1answer
32 views

How to Run Scripts from the Installation Media Within an autounattend.xml file?

I've made some PowerShell (.ps1) and Batch (.bat) scripts that I would like to make part of an automated Windows installation. I have already configured everything else within my autounattend.xml file ...
0
votes
0answers
23 views

How can I write a powershell script which runs as one user, but prompts for a login with encrypted passwords?

To describe the use-case: I'm in the process of writing a powershell script for automation on a local machine, which multiple users have access too. I'd like the script to do specific things depending ...
0
votes
0answers
18 views

Parsing metasploit modules

Can someone suggest me how to parse the modules from https://github.com/rapid7/metasploit-framework/tree/master/modules to a list like use exploit/windows/firewall/blackice_pam_icq use exploit/...
0
votes
1answer
44 views

Can't seem to pass multiple arguments into bash script

I have 3 bash scripts. firstScript.sh that calls secondScript.sh that calls thirdScript.sh firstScript.sh is executed like this in the terminal: firstScript.sh test1 test2 From firstScript.sh, I ...
0
votes
1answer
88 views

Cannot use variable in FFmpeg command as I wanted

I am trying to do a basic hardsub work with FFmpeg in a Powershell script. Here is the code: $subfile = ".\test\sub.srt" ffmpeg -i in.mp4 -c:v h264 -vf "subtitles=${subfile}:'force_style=fontsize=20'...
0
votes
1answer
54 views

How to use PowerShell variables efficiently in a function?

I know the differences calling variable $var vs $script:var inside of a function. Like this: function test() { $var = 1 $script:var = 2 } test if ($script:var -eq $var) { Write-Host "$...

1
2 3 4 5
48