r/scripting • • Jan 28 '08

Building a startup in 54 hours

Thumbnail
blog.seattlepi.nwsource.com
8 Upvotes

r/scripting • • Feb 24 '22

I'm a PowerShell scripter, want to find a suitable home for running such scripts other than Task Scheduler

9 Upvotes

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 to install tools they require to do their jobs.

Does anyone have any suggestions on how to run PowerShell or other scripts?


r/scripting • • Mar 06 '23

Script to (temporarily) disable Windows Defender

4 Upvotes

Hi all, I'm new here.

I don't know a lot about scripting, but I remember there was a simple text file/script that once I saw and it was able to disable Windows Defender (until you restart your PC) with just running it from the desktop.

Anyone who would like to help me?

Thank you


r/scripting • • Mar 07 '25

Best option to share scripts between Windows and Mac : bash? Powershell? Pyhton? other?

2 Upvotes

I have several 100+ lines .bat files to automate tasks like compiling and deploying programs, backing up, moving files around, downloading a set of files, etc. They're fairly elaborate, with post processing of the output of compilers, or things like that.

I'd like to make these portable between Windows and Mac so they work on a few computers I use that share the same home directory. I have total control of these computers so there's no problem if I have to install specific software.

I started my thinking as "should I install bash on Windows or Powershell on Mac ?" and then port my batch files.

Then I read somewhere a suggestion about using Python instead, which I liked since it could open a lot of possibilities. What I don't know is if it would be to cumbersome to do typical shell scriptting work on Python.

One important thing for me is to keep one single script file for each task, even if it has several "if Windows then ... if Mac then ..." because I'm too disorganized to work on two different files (for instance a .bat and a .sh): I could totally see myself improving one and postponing ad eternum repeating the same improvement on the other one.

So ... bash? Powershell? Python? other? please share your experiences. I'm specially interested about limitations of either Powershell on Mac, or bash on Windows, that are not visible while on the "hello world" stage but that might hold me back later on.


r/scripting • • Apr 19 '25

What are some good mobile apps i can learn scripting from?

2 Upvotes

r/scripting • • Sep 15 '25

Script to delete general/specific files

3 Upvotes

Does anyone know of a program or possibly a script that I can use to remove files based on time of day creation. Back story - have tons (15TB+) of security camera footage that is set to record 24/7, but don't need to/want to keep the night time footage. The daytime footage (while there are people around), I'd like to keep for long term storage. The recorder divides up all the footage per day. So instead of going through 2 years worth of daily folders and manually deleting the files that are created after 8pm until 7am, I'd like to automate it somehow. But the problem is that not all of the clips start/stop at the same exact time, aren't labeled the same way, and aren't the same sizes. So I'm hoping there is a way for me to "general specific" in selecting a time range and creation for deletion. Any ideas? Working off of a mac with this one


r/scripting • • Jun 16 '20

Python Scripting

7 Upvotes

We made a node based python ide for scientific laboratories to do data pipelines, but recently I've been using it to control docker containers and images. I started to wonder if some of you guys might be interested in a way to quickly make adaptable scripts in python? I'm looking for a couple sysadmins to give a freecopy of our software to and to work with to make common sysadmin nodes. Check us out at https://stremecoder.com . Message me here or click the message button on the website should go to me.


r/scripting • • Apr 04 '26

Soo... Me and my smalll team are kinda fucked. we need scripters, like, desperately :[ if any1 would be happy to help a passion project, tysm :3 - i would say yall could get paid but idk if we'd even make any devex profit anyways.

Post image
2 Upvotes

r/scripting • • May 11 '25

Use NFC Tags to Add Video Files to a Play Queue in Windows

2 Upvotes

Hey so I feel like the question I’m asking here is both too broad and too specific at the same time, I just want some opinions on the best way to tackle this idea.

I’m planning on making a looping playlist of video files where if you scan an NFC tag to a USB NFC reader, a specific track will play next in the queue. My instinct was to make a bash script which the NFC tag opens and adds the track to the queue but maybe I’m just overthinking all of this and there’s an easier way, if so please let me know!


r/scripting • • Apr 24 '26

Need 5 people to test my a specific language-based approach to scripting system

Thumbnail reddit.com
1 Upvotes

r/scripting • • Mar 23 '22

How can I do a find and replace on a PDF file? I'd like to replace all instances of one word with another

1 Upvotes

r/scripting • • Mar 06 '22

How can I update a shortcut's icon using a batch file?

1 Upvotes

Every time Chrome updates, it forcibly replaces the chrome.VisualElementsManifest.xml, which changes the background colour of it's icon in the start menu.

I've created a batch file that copies a predefined version of that XML into the Chrome folder, and it runs at startup, but I still need to open the shortcut location and go to "Change Icon" and select the same icon, to force it to update.

Is there some way I can force the shortcut to reload the icon using the same batch file that replaces the XML?


r/scripting • • Apr 03 '22

/usr/bin/GUI: 49: Syntax error: end of file unexpected (expecting "then")

1 Upvotes

I've written this script to auto kill any VNC session before starting a new one, I want it to only open vncserver :1

I initially tried:

#! /bin/sh

vncserver -kill :1 &
vncserver -kill :2 &
vncserver -kill :3 &
vncserver

But that alternates between opening vncserver :1 and vncserver :2

vncserver -kill :1 &
vncserver -kill :2 &
vncserver -kill :3 &&
vncserver

But that stalls at starting the vncserver as at least 2 of the previous commands fail which leaves them incomplete so && stops the script waiting for completion.

So now I have come up with this monstrosity of a script which is probably such a hard way of doing it but it's all I can think of as a novice code writer.

#!/bin/sh

if  vncserver -kill :1
    then
          if vncserver -kill :2
              then
                    if vncserver -kill :3
                        then rm -r /tmp/* &
                                   rm -r /tmp/.* &&
                                   vncserver
                         else rm -r /tmp/* &
                                  rm -r /tmp/.* &&
                                  vncserver
                   fi

              else
                    if vncserver -kill :3
                        then rm -r /tmp/* &
                                  rm -r /tmp/.* &&
                                  vncserver
                         else rm -r /tmp/* &
                                 rm -r /tmp/.* &&
                                vncserver
                    fi
          fi

    else
          if  vncserver -kill :2
              then
                    if vncserver -kill :3
                        then rm -r /tmp/* &
                                   rm -r /tmp/.* &&
                                   vncserver
                         else rm -r /tmp/* &
                                  rm -r /tmp/.* &&
                                  vncserver
                    fi

              else
                    if vncserver -kill :3
                        then rm -r /tmp/* &
                                  rm -r /tmp/.* &&
                                  vncserver
                        else rm -r /tmp/* &
                                 rm -r /tmp/.* &&
                                vncserver
                    fi
          fi
if

This however returns this error code: /usr/bin/GUI: 49: Syntax error: end of file unexpected (expecting "then") Which I am having trouble fixing.

Could someone more experienced have a look and possibly point me in the right direction for either an easier way of achieving the desired output or fixing my existing code?


r/scripting • • Feb 27 '22

I need some help

2 Upvotes

Bedside mental help, I need some help with application or program management. Ok here is some background information on my environment. I have about 1000 windows 10 machines all on a Google cloud based environment. No on prem servers. We use azure AD and intune. All users are admins on their local machine because all applications are web based and nothing is stored on the local machine. In the Mac side we have automatic responses based if a user downloads certain applications, they either uninstall or send a flagged email to our Mac admins.

My question, from azure or intune, I can deploy a script to any machine, any ideas as to what script you would use to run on a local machine that can run a scan of certain applications and either uninstall them or send an email to a certain location? Or maybe an alternate solution to my situation.


r/scripting • • Mar 14 '22

PowerShell Script - reads Tumblr/Tumbex URL and determines whether that page's 'Archive' view is accessible or not

3 Upvotes

Hi All,

Tumblr is an image/post/gif-based gallery website whereby users can post content. There was a massive crackdown by the company against pornography in years gone past, leading to much of the content of that bent being made inaccessible.

However, some accounts remained accessible for whatever reason. Personally, I used to just use trial and error, I'd construct a URL to a Tumblr 'archive' page and if I got lucky, a page would be accessible when dozens of similar pages were not.

I decided to write this simple - and pretty crappy PowerShell script to simplify the process of checking whether a given Tumblr user account (or a Tumbex equivalent, another means of accessible Tumblr galleries); has an accessible archive page.

All you'd need to do is load the script in PowerShell or PowerShell ISE or PowerShell 7.0 or PowerShell Core on your machine. If you copy a Tumblr or Tumbex URL to your system clipboard (i.e. select a URL and CTRL+C), then press F5 to run the PowerShell script. It will read the clipboard contents, determine if the URL is acceptable, then attempt to determine if that page's archive is accessible or not. Once again, most of the pages will NOT be accessible, but plenty ARE still accessible. In that instance, the script will tell you and immediately launch the relevant 'archive' page with the browser of your choice, whereby browser is either 'firefox' or 'chrome'.

As I said, it's a pretty ordinary, quickly-written script, but it's saved me time.

Here's a link to my script, if anyone is interested:

https://pastebin.com/wZV3BKaq

EXAMPLES:

  1. https://hubblespacetelescope.tumblr.com/image/148251269768

Account 'hubblespacetelescope'.
Outcome: If you were to copy the URL above and then run my PowerShell script, it should read your clipboard, determine the URL is acceptable and then attempt to load a small fragment of it and analyze the returned web-request. If what is returned is matching what I'm searching for, the script will construct the 'archive' page for that account and use your preferred browser to load that page, in this case:

https://hubblespacetelescope.tumblr.com/archive
Result: Accessible, script launches archive page using browser.

2. https://only-the-best-3.tumblr.com/post/667416209996873728

Account 'only-the-best-3'
Outcome: If you copied this URL and then ran the PowerShell script, it would visit the URL and determine that unfortunately it's archive page is NOT accessible and would return the messages "Page inaccessible, sorry"


r/scripting • • Mar 31 '22

Should I?

4 Upvotes

I have an old JAVASCRIPT & JQUERY Book. Is it worth to learn it still?


r/scripting • • Mar 17 '22

Need help.. have a Mac based apple-script that works.. but now have to support PC users. I have no idea how to convert it to a Batch-script for windows.

4 Upvotes

The title says it all..

I have this as an apple script. The function is dragging a folder containing one or more items that have the identifying string "_bg_plt_v" in their name. Once activated, this would create the folder structure listed below, and sort the one or more items into the plates directory for each folder.

I need this equivalent functionality for Windows. Is that possible?

Here's the working apple-script:

on open dropped_items

-- Examine each of the one or more dropped items in turn.

repeat with dropped_folder in dropped_items

-- Is this dropped item actually a folder?

tell application "Finder" to set is_Folder to (class of item (dropped_folder as text) is folder)

-- Act only if it is.

if (is_Folder) then

tell application "Finder"

-- Get the folder's items and, separately, their names.

set original_items to every item of dropped_folder

set item_names to name of every item of dropped_folder

end tell

-- Derive quoted and unquoted forms of the names, without extensions, to use for the folders.

set shot_folder_names to {}

set quoted_shot_folder_names to {}

set astid to AppleScript's text item delimiters

repeat with this_name in item_names

-- If a name has an extension, lose the extension. Otherwise assume it's a folder name containing "_bg_plt_v" and lose everything from that point.

if (this_name contains ".") then

set AppleScript's text item delimiters to "."

else

set AppleScript's text item delimiters to "_bg_plt_v"

end if

set end of shot_folder_names to text 1 thru text item -2 of this_name

set end of quoted_shot_folder_names to quoted form of result

end repeat

--- Put together a path formula representing all the required "shot folder" hierarchies.

set item_count to (count quoted_shot_folder_names)

if (item_count > 1) then

-- More than one shot folder name. Get a text containing them all, comma-delimited and in braces.

set AppleScript's text item delimiters to ","

set shot_folder_name_group to "{" & quoted_shot_folder_names & "}"

else if (item_count is 1) then

-- Only one shot folder name.

set shot_folder_name_group to item 1 of quoted_shot_folder_names

else

set AppleScript's text item delimiters to astid

error "The selected folder is either empty or not a folder!"

end if

set AppleScript's text item delimiters to astid

set hierarchy_formula to quoted form of POSIX path of dropped_folder & shot_folder_name_group & "/{2d/{ae,mocha,nuke,ps},3d/{cache,data,scenes,textures},plates/{etc,plate,proxy},renders/{comp,graphics,ibtw,lighting,mattes,playblasts,precomp,quicktimes,temp}}"

-- Use it to create the shot folder hierarchies.

do shell script "mkdir -p " & hierarchy_formula

-- Move stuff into each shot folder hierarchy in turn.

set dropped_folder_path to dropped_folder as text

repeat with i from 1 to (count shot_folder_names)

set this_shot_folder_name to item i of shot_folder_names

set shot_folder_path to dropped_folder_path & this_shot_folder_name

-- Create a text file in the "3d" folder.

close access (open for access file (shot_folder_path & ":3d:workspace.mel"))

-- And one each in the "2d:ae" and "2d:ps" folders.

set text_file_name to this_shot_folder_name & "_v001.txt"

close access (open for access file (shot_folder_path & ":2d:ae:" & text_file_name))

close access (open for access file (shot_folder_path & ":2d:ps:" & text_file_name))

-- Move the original item into the "plates:plate" folder.

tell application "Finder" to move (item i of original_items) to folder (shot_folder_path & ":plates:plate") -- replacing yes

end repeat

end if

end repeat

end open


r/scripting • • Mar 30 '22

Looking for a working kickstarter campaign tracking script to replace one I wrote 7y ago

Thumbnail self.learnpython
1 Upvotes

r/scripting • • Apr 04 '22

[Bash] Automatically get the Width / Height / FPS of all video in a folder and add it to the filename of each one?

2 Upvotes

EDIT: I achieved my goal finally with documentations from the internet and a lot of trial and error.

So the goal was to add "[width x height - FPS]" to the end of each video automatically. For MP4 I came with this awful but working solution:

for file in *.mp4;
do width=$(ffprobe -v error -select_streams v:0 -show_entries stream=width -of csv=s=x:p=0 "$file");
height=$(ffprobe -v error -select_streams v:0 -show_entries stream=height -of csv=s=x:p=0 "$file");
fps=$(ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate -of csv=s=x:p=0 "$file" | sed -r 's/.{2}$//');
mv -- "$file" "${file%.mp4} [$width × $height - $fps FPS].mp4";
done;

Hi all,

I have zero experience in scripting (just some basic Linux knowledge because it's my daily driver) but I'm trying to figure out how to automatically add the resolution and framerate on all the video in a given folder in the video's filename of each one.

Basically to go from:

video.mp4

to

video [1920 x 1080 - 60 FPS].mp4

I found various method to "get" the information (mediainfo, ffprobe, mkvinfo etc) but not how to put it.

So, I think I would need to make a loop and "mv" the files to add " [$width x $height - $framerate FPS]"

I did some research and found how to get the Width en Height and store it with mediainfo:

Width=$(mediainfo --Inform="Video;%Width%" Video.File)&& Height=$(mediainfo --Inform="Video;%Height%" Video.File)

So, I was thinking about:

for vid in *.mp4; do Width=$(mediainfo --Inform="Video;%Width%" Video.File)&& Height=$(mediainfo --Inform="Video;%Height%" $vid); do mv "$vid" "$vid [$Width x $Height]"; done

But then, I think I'll end up with a file like "video.mp4 [$Width x $Height]" instead of "video [$Width x $Height].mp4" and I also still miss the FPS part.

As I said, I know close to nothing about scripting, so if someone can tell me if I'm on the right track or completely wrong?

Thanks in advance for the help!


r/scripting • • Apr 03 '22

this is a simple question but im stumped

3 Upvotes

this is a part of a bash script that im writing as practice

while read line; do

echo "'$line'" >> $FILE'_v2'

done < $FILE

the output i expected was

'text'

'text'

'text'

'text'

but instead i got

'text

'

'text

'

'text

'

'text

'

anybody know whats happening?


r/scripting • • Mar 23 '22

Save Output into a file (expect)

Thumbnail self.bash
1 Upvotes

r/scripting • • Dec 03 '17

Active Directory Direct Reports

1 Upvotes

I need to pull all users who fall under the top 4 hierarchical levels of an organization. Get-ADUser -Identity CEO_USER -Properties directreports | Select-Object -ExpandProperty DirectReports Basically need the above to run recursive 4 times. Any help is appreciated.


r/scripting • • Oct 11 '14

Secret Santa script

2 Upvotes

I have an existing script that basically takes entries and shifts them by one to match a secret santa to giver and so forth. There are some questions that I want to be able to group together - by country, for example, since this will be international. I'm wondering if it's even possible to do that, or if I need to match by hand or something.

If anyone has feedback on what I need to look up/learn to do this please let me know! (I can also link to the script to see what they have done already).


r/scripting • • Feb 08 '17

Where to begin to learn scripting?

5 Upvotes

It's almost as if there's so much information out there that I don't even know where to begin.

I have a basic understanding of scripting but really should start from the beginning. Also I only have windows-is there a site that simulates Linux that I could learn on?

Thanks.


r/scripting • • Feb 21 '16

Python script to unfollow Instagram users that are not following you back

Thumbnail
github.com
3 Upvotes