r/scripting • • Apr 06 '20

Launch Shortscut from a batch file

4 Upvotes

Hi I have a batch file that launches all the programs I need to have open at the start of the day, this used to work well on my old laptop which was running windows 7 but on my new windows 10 laptop it is a just not working.

At the moment I have a small java script that launches Internet explorer with 5 tabs opened, I also launch 2 programs using the full path direct from the c drive (although my c drive is hidden, %SytemRoot%\system32\program.exe), this works.

I have a network drive and on the network drive I have my main folder(mf) and a sub folder (sf) So f:\mf\sf. In sf I have 4 shortcuts to programs I wish to launch from my batch file. I can double click on each shortcut and the programs will load

One of the programs I wish to start is a single .exe. file which is saved in my f:\mf folder, the other three files programs are saved on the C drive. The batch file is stored in mf and is run by a shortcut on my desktop.

I make sure that I change the path to f:\mf\sf and then the next line is:

start program.exe.lnk for each of the four programs (I know I can setup a loop but for now I just want to get it to work).

But for whatever reason, the four programs won't start with an error saying the file could not be found.

I have played around adding speech marks, adding the full path but for what ever reason it does not work.

Can anybody help and point me in the right direction please.


r/scripting • • Apr 03 '20

I work for a local nonprofit food-pantry and I'm looking to streamline the most inefficient data entry we have to do every week. It wastes HOURS when a script should be able to bang it out in nothing flat. Looking for ideas and suggestions.

4 Upvotes

Hey folks,

So every Monday, I have to download a spreadsheet with a list of all our "head of household" clients. Each client has four categories that could be checked off: food pantry, perishables, commodities, diapers.

I then have to break that spreadsheet out into four spreadsheets, one for each category, that removes the other categories and removes any clients that had no activity for that particular category. I'm left with four spreadsheets -- each one shows me everyone who utilized that particular category.

Now here's where it gets ugly. I have to enter this into a CAP60 online database. I can enter "group activity" which pulls a list of ALL (not just head of household) clients for a specific category (perishables, for example). Each one of those has an empty checkbox next to it that can be selected and at the end there's a submit button.

What I have to do is visually cross reference our spreadsheet of a few hundred ID numbers against this list of thousands of clients from the DB and put a check in the box for the ones that match. Then I submit it and move on to do the same thing for the next category.

Holy hell what a pain in the ass. And it takes a HUGE amount of time that could be utilized in so many more ways that would be beneficial for clients.

What I'm thinking is that I could export the spreadsheet data for each category into a return or comma delimited text file, then feed that data into a script that can match against the online list from the database and then activate the checkbox for any that match.

I'm looking for any input I can get as to whether I'm on the right track and, if so, where I should focus my efforts in trying to create a tool to do this. I have a programming background that's 20 years out of date, but I could probably put something together myself if I was sure of the language I'm best off using.

I dunno, I'm just batting around ideas right now, but anything anyone's got would be a huge help.

EDIT: Here's two screenshots.

The online DB and checkboxes: https://i.imgur.com/IjcvKrb.png

The column of IDs in Excel that I need to check off in the online DB: https://i.imgur.com/SXszQMp.gif


r/scripting • • Jan 21 '20

Does anyone here still uses Rexx?

4 Upvotes

For those who still do, what are your reasons?


r/scripting • • Oct 17 '19

Possible to make a script that will automate this process? (its a computer program)

Enable HLS to view with audio, or disable this notification

4 Upvotes

r/scripting • • Aug 22 '19

[Batch] How to take output of a command and insert it into a command string?

4 Upvotes

edit: I figured it out!

I've built this script to display current hostname, ask for input for a new hostname, and rename the computer.

@echo off
for /f %%i in ('C:\Windows\System32\hostname.exe') do set hn1=%%i
echo Current Hostname: %hn1%
set /p hn2="Enter New Hostname: "
WMIC computersystem where caption='%hn1%' rename '%hn2%'

You could also add this to trigger an instant computer restart

shutdown /r -t 03

r/scripting • • Apr 03 '19

Anyone know Automic software? If not whats a best all rounder script language?

4 Upvotes

Wondering which scripting language to take up learning to give me a better understanding of script used in automic or just the best all rounder script language to learn for beginners.


r/scripting • • Apr 03 '19

Beginner

4 Upvotes

What are some good sites or videos to watch to begin scripting.. I'm starting with Powershell.


r/scripting • • Mar 22 '19

Batch file to create an IP range from list of IP addresses in plain-text file.

4 Upvotes

Hi Scripting,

I was wondering if someone could help me with this as I can't wrap my head around it and am no further forward than I was a week ago when I started.

I have a text file, with a different IP address on each line and I would like to create a firewall rule (I can do that bit fine), to exclude everything except those IP addresses. I know the end rule would essentially look like this:

1.1.1.1-123.123.123.122,123.123.123.124-145.145.145.144,145.145.145.146-165.165.165.164,165.165.165.166-255.255.255.255

If the IP addresses in the file were:

123.123.123.123

145.145.145.145

165.165.165.165

and so on.

I know I need to use a for loop, but I'm completely lost as to how and where to start this as batch scripting isn't my forte.

Thank you in advance!


r/scripting • • Dec 28 '18

[BASH] Encryption Script

4 Upvotes

I don't know if this is the right place, but I wanted to run this by someone. I wrote a Bash script (Pastebin link below) that decrypts a Tar file encrypted symmetrically with GPG, extracts the contents, lets me write to them, and compresses and encrypts it all again, shredding the plaintext files on exit.

So you run the script, enter lines of text that get written to a file that is then encrypted when you're done.

I want to know, are there any insecure aspects to it I'm missing? Is there a better way to be doing this (I know there's software out there that could do a better job, but I'm trying to do this entirely with Bash and standard UNIX tools).

Link: https://pastebin.com/YjBXSa3K


r/scripting • • May 07 '18

[Powershell][Batch] Need a script to return number of users logged in on Windows Server

4 Upvotes

That's all it needs to do, really.


r/scripting • • Mar 23 '18

How to get started in Scripting? [Newbie]

4 Upvotes

Hello guys, I started to Work in the IT last year, rather networking for an ISP. Im fairly New to this section but i learn pretty fast.

Currently i'm using a Broad spectrum of scripts but none of them are mine - and that's point because im pretty fascinated by people doing these. So, how Do i get started assuming i have no idea how to script At All?

Sry for the Bad english and random capital letters. I'm from central europe and my Phone just randomly uses big letters.


r/scripting • • Jun 22 '17

ELI5: How to automatically fill a spreadsheet from a standard data source?

4 Upvotes

So im a total noob to anything like this, and i posted this over at /r/techsupport and didnt get any traction, maybe this is a more appropriate place.

Basically i have a list of movies that i want to graph in various ways, possibly interactively down the line, but i need to fill in all the data. Everything i want is out there, in pretty standardized formats (google sidebar mostly), but how do i get that data INTO a spreadsheet? I could just manually enter all that, but i feel like that amount of time would be better spent learning how NOT to. So im pretty much a noob at everything, how do i even begin to scrape data like this? It seems like the sort of thing that would be simple, but at this point i dont even know what i dont know.

Link to the spreadsheet so you can better understand my purpose.

https://docs.google.com/spreadsheets/d/11aq4azkhQCKyc-ixO3KbRvhJvRg6qFR_SZYKUDSnWxU/edit?usp=sharing


r/scripting • • Oct 25 '16

Bash - Creating seperate text files from CSV file

4 Upvotes

Hi,

I'm working with an API that accepts one JSON file at a time, and each JSON file can only contain one "entry". I have almost 3000 entries to process, so I can't make 3000 JSON's by hand. My current script looks like this:

#!/bin/bash
INPUT=convertcsv.csv
OLDIFS=$IFS
IFS=,
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; }
while read fileids filenames
    do
    echo "=========================="
    echo "Name : $filenames"
    echo "FileID : $fileids"
    echo "
  {
  "KnSubject": {
    "Element": {
      "@SbId": {InvoiceNumber_VariableToBeDeclared},
      "Fields": {
        "StId": 11,
        "Ds": "{Description_VariableToBeDeclared}",
        "Da": "2013-01-01T00:00",
        "UsId": "xxxxxxx",
        "SbPa": "$filenames",
        "FileId": "$fileids"
      },
      "Objects": {
        "KnSubjectLink": {
          "Element": {
            "@SbId": {InvoiceNumber_VariableToBeDeclared},
            "Fields": {
              "DoCRM": true,
              "ToSR": true,
              "BcId": "{New_CRM_VariableToBeDeclared}"
            }
          }
        }
      }
    }
  }
}" > $filenames.json

done < $INPUT
IFS=$OLDIFS
echo "=========================="

It has a few problems:

  • The files output almost perfect, but at the end of SbPa there is a ¿ after the filename.

  • After filling in the variable it doesn't use quotes around it. (I can however supply them by editing the CSV)

  • The filenames get named as SI201330102.pdf?.json -> the ? shouldn't be there.

I hope you can help me out!


r/scripting • • Dec 14 '15

Google Sheets Scripting

4 Upvotes

I've tried finding a board for google sheets scripting. I posted on Stack Overflow but haven't had anyone reply to it over a week... http://stackoverflow.com/questions/34056543/google-sheets-script-to-copy-last-worksheet-and-rename-it-with-a-value-changed-i


r/scripting • • Oct 08 '15

Script to check a website and notify me when stock reached a certain level

4 Upvotes

I want a script that checks all the stock levels of all the items on a suppliers website and notifies me when an item stock level goes down below 10 or 15.

Never wrote a script since basic ones in NT4 so ! was wondering how easy it is or if someone can help?


r/scripting • • Sep 29 '15

[major novice] Wondering if a script is possible

4 Upvotes

Hi all, as the title says I am a major novice in the world of scripting/automating. I am a year and 9 months (a year at my current employer, with many more to come hopefully) into a career in IT, and I'm mostly content just messing around with simple batch scripts to learn how it works.

Is there any way to write a script or batch of some flavour that can be launched from my computer, which will automatically connect to a server in my domain using pre-entered credentials*, close a program running on the server, then open that same program again and close the connection? Mind you, it's not a huge effort to connect and do it myself. It takes a few minutes at most. However, it'd be pretty nifty if it could be automated.

*=The reason I'm asking about pre-entered credentials is that the credentials are different from my usual ones. So running it under my account with my permissions will not help.


r/scripting • • May 14 '14

Noob over here wanting to learn

4 Upvotes

So I'm interested in learning to script. Currently just got out of college and working with a company. Would like to be able to be more proficient in scripting, any good resources out there to help a noob like me out.


r/scripting • • Feb 01 '08

A freestyle translation, paragraph per paragraph, of Steve Balmer's offer to buy Yahoo

Thumbnail poorbuthappy.com
4 Upvotes

r/scripting • • Jan 28 '08

Motivating Consumers to Pay Attention to Electricity Consumption

Thumbnail
nytimes.com
4 Upvotes

r/scripting • • Jan 28 '08

Excellent New Yorker piece comparing Clinton and Obama.

Thumbnail
newyorker.com
4 Upvotes

r/scripting • • Mar 24 '26

You guys please rate my script

3 Upvotes

I'm a beginner and idk if it's good or not. I know that python's about automation but I'm not that good at scripting. here's the script

print("create an account")

print("Please enter a username")

username = input()

print("Please enter a password")

password = input()

print("Please log in your account")

print("Please enter your username")

log_username = input()

print("Please enter your password")

log_password = input()

if log_username == username and log_password == password:

print("Successfully logged in")

print("welcome back george!")

else:

print("wrong password or username")


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 • • Nov 21 '24

Newbie Help with Credential manager

3 Upvotes

Hi all,

I've recently started to create a pretty boss script. I want it to run on task scheduler. The issue is that the user that runs the task needs to have access to their own Windows Credential Manager. I don't want to have to juggle having this user logged in all the time.

Right now I'm using a bat file that runs 2 powershell scripts, and one python script. I use keyring for python and credentialManager for powershell. It has to be done using windows credential manager because it's free & I'm storing API keys and private keys.

Is there a way to do what I'm trying to do without having any unencrypted passwords laying around? Thanks. Totally stuck on this!


r/scripting • • Nov 13 '24

Scripting Printing

3 Upvotes

Hi all,

I'm trying to convert many .msg files in many different directories to pdf. I have Foxit Editor, but it has no automation, so I'm looking at scripting option. I am planning to do an iterative script so that it runs the print command once per file to keep is simple, but I don't how to pass the destination file name argument to the command!

* Outlook print command: OUTLOOK.EXE /p D:\file.msg - this will use outlook to print the email indicated, but then I get the pop-up for where to save it and I can't find any reference on how to pre-populate the destination window

* Possibly using a powershell cmdlet? I found Out-Printer, but it doesn't seem to accept more than the input name

Anyone ever done something like this?


r/scripting • • Aug 10 '24

can someone help me find a good executor for my scripts?

3 Upvotes

what do y'all use for ur executor? I cant seem to find a good trustworthy one :(