r/scripting

1.6K archived posts · Jan 2008 – May 2026

Random post


u/dverbern•

Hi All,

I'm no programmer, but I've built up some basic skills with Microsoft PowerShell and VBScript for fairly straightforward systems automation, health monitoring scripting solutions.

Up until now, I've been 'happy' with those scripts that need to run on a schedule being controlled by Windows Task Scheduler.

However, in recent times I've questioned whether this is the best home and whether other automation platforms like Jenkins might well be more secure, more fit-for-purpose, etc. Furthermore, by accidents of history, several scripts have ended up being scheduled to run from server 'jump boxes' which have become polluted over time due to multiple IT teams having local admin access

1024

u/Phydoux•

I'm just patting myself on the back here. Nothing special to look at here just the fact that I'm discovering this new function and hope to expand on it a bit in the future...

Anyway, I'm all about making things easier for me. I recently started looking into scripting so I can make some of the command line stuff I use easier to remember.

For instance, I prefer to look at a nice long list of my directory when I want to see what's in it rather than the wide info less detail I get with "ls". I know I can type "ls -lha" to get the long list I want but I found that I do that a lot and it gets sort of bothersome (I know... 7 keystrokes... WHEW!!!)

So I watched a few videos on the basics of scrip

90

u/Hvilke•

I tried making a script in task scheduler that would automatically change my wallpaper. Here is the script which i saved as a .vbs file for task scheduler to run:

dim shell

Set shell = WScript.CreateObject("WScript.Shell")

wallpaper = "C:\path\to\wallpaper.jpg"

shell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", wallpaper

shell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True

The script is from this forum post if you want to check it out.

**Problem is, when I run the task all that happens is that a window comes up and asks "How do you

86

u/nasty_nas03•

Hey guys I recently wrote a script that is able to take any Glassdoor search and applies for all the easy apply jobs within your search query so that you wont have to fill out your application out multiple times. I hope it helps, this is only the beta so I hope to keep improving it, let me know if you have any suggestions to make the script any better thanks.

​

https://www.youtube.com/watch?v=gEMRnrLJLWI

https://github.com/pranav-manik/Glassdoor-Application-Filler

71

u/bob_loblaw_brah•

Hi all,

I have a mass deployment of Windows 10 based AV systems with USB PTZ cameras as well as USB document camera.

When running zoom on multiple user logins, Zoom randomly selects either camera, whereas we want it to be statically set to choose the PTZ camera every time. I've heard of others using a script that uses the Zoom icon on desktop that opens the Zoom and selects the PTZ camera based on regedit ID. I cannot seem to locate any information on this on the web, or I'm searching incorrectly.

Any ideas?

Thanks in advance!

72

u/Mr_Hypnotiq•

Hello all! I have more than 1,000 csv files in a folder that I need to edit. Does anyone know how this can be automated. I need to add 4 columns to the end of the csv and populate those columns with zeros. I would like to save the files without renaming them. Any help is greatly appreciated. :)

example of csv:

Name= 200401.csv

Original file example=

Date,Time,LS1_P1St,LS1_P1HrCalc,LS1_P2St,LS1_P2HrCalc,LS2_P1St,LS2_P1HrCalc,LS2_P2St,LS2_P2HrCalc,LS3_P1St,LS3_P1HrCalc,LS3_P2St,LS3_P2HrCalc,LS4_P1St,LS4_P1HrCalc,LS4_P2St,LS4_P2HrCalc,LS5_P1St,LS5_P1Hrs,LS5_P2St,LS5_P2Hrs

2020-04-01,23:59:52,31,31,32,21,8,2,8,2,2,0,1,0,9,0,9,0,0,0,1,1

I would like to add columns: LS6

714

u/rkusty23•

Does anyone know of any good free tutorials/classes for a beginner who wants to get into scripting? Preferably python or JavaScript

61

u/JrohdaJolly•

So I’m in what is supposed to be an intro class to scripting and I’m not gonna lie, not only have I never done any scripting at all but I also barely understand it and the teacher just isn’t breaking it down enough for me. I just need some serious help and I’m hoping someone here is willing to help and then maybe even chat with me to fill in some serious pot holes I have in my knowledge. The assignment is for me to “Create a VBScript (w2_firstname_lastname.vbs) that takes three parameters (numbers) to do the following:

  1. Print the sum of three numbers
  2. Print the average of the three numbers
  3. Optionally, you can save the list into a file “Results.txt” using the redirection operato
61

u/SAV_NC•

It finds the process name and its PID of the program using the port you specify.

just pass it the port number like so

check_port 443

​

check_port() {
    local choice kill_choice pid name

    if [ -z "$1" ]; then
        read -p 'Enter the port number: ' choice
    else
        choice="$1"
    fi

    echo
    # Getting the process information using lsof
    while IFS= read -r line; do
        if [[ "$line" == p* ]]; then
            pid=${line#p}
        elif [[ "$line" == c* ]]; then
            name=${line#c}
        fi
    done < <(lsof -i :"$choice" -sTCP:LISTEN -Fpc)

    if [ -n "$pid" ] &&
60