Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
15 views

How to add QOS to Local Computer Policy with Powershell

I have this code and it works but it makes a domain GPO policy and not a local one. How do i get it to make it local? #Create QOS for RDP Session #Create a new Group Policy Object (GPO) that will be ...
0
votes
0answers
25 views

Changing Power Options with Powershell

I am a newbie when it comes to scripting. I am running the script above. I believe I have to take and change this line of code: {param ($Plan = $(throw ‘Set-PowerPlan Ultimate Performance’ ))} but I ...
1
vote
1answer
24 views

Why does command substitution not work in braces but replacing it with the actual number works?

I'm using the following command to try to max out the number of cores on my server: for i in {1..`nproc --all`}; do while : ; do : ; done & done For some reason, it only ever uses one core, even ...
0
votes
1answer
16 views

How to filter out user keyboard only login times from the 4624 Event Log data?

I am trying to filter out from the Security Event Log, those logs which correspond to the user (me) logging in by typing out password on the keyboard. I would like it to detect unlocking the screen as ...
0
votes
1answer
31 views

Bash script, get number of physical cores as number and iterate

I wrote a script that shows a number of physical cores of the machine. However, I would like the result to be a number, not a string. Here's the script: phycores=echo $sudoPW | cat /proc/cpuinfo | ...
-1
votes
2answers
30 views

Bash Command Substitution doesn't work

This is the script: #!/bin/bash thedate=$(date) var='Current date is $thedate' echo $var The output is Current date is $thedate and I'd like to make it show the date,what did I do wrong? ...
0
votes
1answer
38 views

Vim run command in background, but show output live in vsplit

How can I run a terminal command (for instance build) in vim while working on a file, while simultaneously showing the output live in a vsplit?
0
votes
0answers
15 views

Batch Script or alternate script [duplicate]

I'm not sure if this is the correct platform to ask on but here I go. I'm working on windows 10. I have a lot of files generated into one folder from a script with different parts to the name. I ...
0
votes
0answers
62 views

Shrink (scale) an SVG image via command line, while preserving its size

How can I shrink the content within an SVG file from the command line? I'd like the output to have the same default width and height, but be smaller. I'd also like for the scaling to be relative to ...
0
votes
0answers
34 views

How to run a command when any process starts?

I have an sh script to update my wallpaper which uses pscircle in order to display running processes. The script runs every five seconds to update the wallpaper, but I would like it so that the script ...
0
votes
1answer
19 views

When I change working directory in a script and execute it, the working directory only changes to specified path while in the script

When I change working directory in a script and execute it, the working directory only changes to specified path while in the script. Here is my script: #!/bin/bash cd /media/hard/drive/partitionX/ ...
0
votes
0answers
27 views

Haw can I execute my VB script in every 5 minutes automatically

I write a VB script and I need to run this script as a trigger in every 5 minutes My code is as follows: Sub Write_data_record_into_a_table() '////////////////////////////////////////////////////////...
-4
votes
0answers
16 views

script for Linux Current Date zip file from the folder and moved to windows folder on network [closed]

Actually i am looking for script for linux to get the current date zip file from the folder and moved to windows folder on network. Thanks & Regards Nawaz
0
votes
0answers
36 views

Importing txt-values from FTP

I'm trying to get text in a .txt from an FTP which i want into excel, this is what i got from our supplier support so far: Make a file named GetFromFTP.bat with this in it. echo off c: cd\import ftp ...
0
votes
1answer
43 views

NoDriveTypeAutorun registry key missing from Windows 10

I want to add a few lines to a script with the capacity to enable/disable the Autorun feature. It's not a new concept. It's been covered countless times before, including here on StackExchange, and ...
0
votes
0answers
40 views

Batch and scheduled download on Windows

complete noob here. For work I need to find a way to download all the files that are on a webpage. Moreover I would need to perform this operation everyday, around the same time. For this reason I ...
0
votes
1answer
78 views

Powershell: compare and match specific part of filename

I have something want to use Powershell to write. Could anyone know it? Thanks. I use powershell to create a list. e.g. $SUID = @("0011", "0012", "0013", "0014", "0015") I have a folder containing ...
-1
votes
1answer
45 views

Can Firefox script steal my files?

I use Xubuntu 18.04 and the way I use Firefox is this: I downloaded and unpacked Firefox in my home directory; then I "chmod a-w firefox" so that nothing in that directory can be modified. Yesterday ...
0
votes
1answer
30 views

PowerCLI Get VMs those fit some conditions

I'm trying to get our some Linux distros from vCenter by using PowerCLI. But I don't want to get Appliance VMs. So I have 2 different successful PowerCLI scripts those can find these machines. I want ...
0
votes
1answer
42 views

Need Batch File/Script To Find Multiple Usernames Using Their Machine Names [closed]

I have a list of about 200 machine names. I need to get the UserName of the person on each of those machines. I can do it individually using the following command. But I'm not looking to do this 200 ...
0
votes
1answer
59 views

Automatically mute Windows volume when I'm at work?

On my Android phone, I have a little script that fires whenever it connects to a new Wi-Fi hotspot, that I have set up to set everything to mute when it sees the Wi-Fi at work. I'd like my work ...
1
vote
0answers
49 views

What are the best practices to make sure a “death will” script will go off when you die? [closed]

I like to ensure to a reasonable degree that a bunch of scripts will be executed if I’m dead. Are there any open-source solutions streamlining this process? What are the best practices I should keep ...
2
votes
1answer
67 views

Move files to a folder named by part of their filename

I have files from a GoPro Fusion camera that represent images and movies.  The filenames look like GP (for “GoPro”) (two more letters of no particular ...
0
votes
0answers
23 views

Reboot script for ubunut on system hang

I have created a Qt app for Ubuntu 16.04 which will run every time when system is on. But sometimes I have seen that the system is getting frozen or hang when the application is running for long time. ...
-1
votes
1answer
41 views

How to create a column where all values from A are linked to B?

I even had a problem to formulate the question. I will give you an example and then I think it will be more understandable. Let's say we have the following data in Excel: And then I want to connect ...
-2
votes
1answer
70 views

gzip command is not working in shell script [closed]

If I run my script through crontab, gzip is not working fine. If I run the same script manually gzip is working. The command we have in our script is gzip -vf $path/file.eee In my script I am ...
0
votes
1answer
18 views

Run VBS script with privileges on computer startup / log in

I have script.vbs that I want to run on computer startup, after login to Windows. Tried to place it in startup directory -> doesn't work. Tried to select this in Windows's task scheduler -> doesn't ...
0
votes
0answers
36 views

Complex Multiple folder batch files - level 3 sub folders

I am looking at setting up a 3 level folder structure for approx. 5500 'assets' with each level 1 folder containing multiple (13) level 2 subfolders. I have managed to get this far using the script ...
1
vote
1answer
72 views

Automatically open a file when it is added to a directory, with PowerShell

I have a script (.ps1) that is monitoring a directory, and when a file is created it should open that specific file (in this case a .pdf). There are multiple files in the directory, but it should ...
1
vote
1answer
34 views

What's the command to change an EXE to run as an administrator?

Is there a command I can run, outside of the Windows GUI, to change a program so it will always run as administrator? I have several hundred .EXE files to change, and it's tedious to touch each one ...
0
votes
1answer
59 views

How do I check what a txt file contains, and if a fixed number of the last characters match a variable, then delete those who match?

I have a batch script that need to check what a textfile (.log or.txt) contains. When it's done checking, it needs to delete those lines that contain the same configuration of charachters that is ...
0
votes
0answers
6 views

Synology NAS - custom script after join a Windows Domain possible?

I have a Synology NAS DS415 and I have a question: Is it possible to start automatically a custom (bash) script after a special action. I need to do some configuration stuff after the  Synology NAS ...
4
votes
2answers
604 views

How do I check if the three last characters of a variable match another variable?

I have %var1% and %var2% var1="UserInput" var2=file.log If a user types %var1% as "file.txt", how can I (if possible) check only the three last characters (Or the file format if that's possible) to ...
1
vote
1answer
39 views

Batch file: Run command and loop at same time

I want to run a simple batch script that basically includes only two Wireshark commands: @echo off dumpcap -i 1 -f "tcp port 8800" -a "filesize:100" -n -w "data.pcap" && :loop start tshark ...
0
votes
1answer
84 views

What does this password script do? [closed]

Found this file on a unit at work... Set WshShell = CreateObject("WScript.Shell") PINGFlag = Not CBool(WshShell.run("ping contoso.com -n 1 " & vSystemIdentifier,0,True)) If PINGFlag = True ...
0
votes
1answer
36 views

Pipeline after sourcing a bashscript

I have a code # Inside Child.sh ChildVariable=BigChild # Inside Parent.sh source ./Child.sh echo "ChildVariable=${ChildVariable}" Output: ChildVariable=BigChild But, # Inside Parent.sh source ....
0
votes
0answers
23 views

Making registry changes to current user not applying outlook settings

I'm attempting to set a handful of registry keys for trusted documents and outlook settings from a batch script I created to launch an application through Citrix. The script works for the most part, ...
0
votes
1answer
10 views

How to pause service and alert when volume is not ready?

Under Windows 10, would it be possible to display a pop-up and pause a sync service when a specific usb drive is not found? Best regards, Gilles
0
votes
0answers
42 views

python 2.7 WMI script speed up

I am a beginner in Python. I want to check who was the last user logged on a Windows PC in domain. My Script works fine but it's very slow. The script needs about 12 hours because there are many pcs ...
0
votes
2answers
67 views

Powershell script how to silent supply values for the following parameter?

I have this script copying first month backup file from directory to another. This works fine but needs user intervention and not execute automatically. How i can silent this message ? Here is the ...
1
vote
1answer
44 views

Batch: Set Top-Level Folder Name as Variable

Environment: Windows 10 Question: If possible - how do we set the name of the top-most folder on a drive as a variable? We receive a disc from a third-party that contains updates to a system we use - ...
1
vote
1answer
32 views

wmic result to named text file

I am writing a batch script to install software that is 32 or 64 bit dependent. I am using "wmic os get osarchitecture" to determine the architecture of the Windows OS. What I am looking to do is ...
1
vote
0answers
50 views

Need help writing a Powershell script to check 20 URLs(Web Application) , URLs loads in IE and get page response to a file [closed]

My Requirement: We have 20 different URLs(Web Application), we have to browse each URL in a IE browser and enter the user name and password . Same user and password for all 20 URls. We will check the ...
0
votes
2answers
75 views

Powershell - Why can't use this variable in my script?

why can't use this variable in my script? i run script with parameter "Untitled1.ps1 -filePath C:\scripts\test01 -logPath C:\scripts" and result is step1 C:\scripts\test01 C:\scripts step2 C:\...
2
votes
1answer
60 views

Execution of a command locally after ssh tunneling

I have a script file ./run_app.sh which contains of the following: ssh -L 8888:localhost:8888 ubuntu@address ./run_website.sh # it should be executed locally but it tries to run the second line on ...
4
votes
2answers
57 views

Search for most recent file under a directory and copy the folder containing it to another directory

In my directory I have many files with the same name also in many other subdirectories example file structure: C:\a\first\hello.txt C:\a\second\hello.txt C:\a\third\hello.txt I need to ...
0
votes
1answer
28 views

How can I “findstr” all links from a source-code of a webpage?

I want to have just the https-Link in a seperate file. How do to that without getting the complete line of the code, just the links?
0
votes
2answers
67 views

Remove duplicate files by comparing them with MD5 RECURSIVELY

i want to delete duplicate files based on their MD5 value. I already got the script down below but how do i modify it so it works recursively? So for example i have folder containing 3 subfolders A B ...
0
votes
3answers
40 views

How can I execute all commands in crontab subsequently?

Consider a complicated crontab of +100 lines where a lot of scripts are run subsequently to poll & process messages from different clients. Upon reboot of the server, I trigger some scripts of ...
0
votes
2answers
104 views

Loop and extract files matching a path

I am currently in a directory with many directories. $ ls the bad icons 100 the games icons 100 the beach & camping icons 100 the halloween icons 100 How can I extract ...