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.
2,743
questions
0
votes
0
answers
14
views
Is there a way to automatically switch between two windows of the same app in Windows 10 [duplicate]
I have two windows of the same program that i am constantly switching over manually, (each window needs the whole screen). Is there a way to automate the process of switching between them for let's ...
0
votes
2
answers
33
views
While Function - Loop on failure to match input password for new AD user creation script
I am creating a script with basic variables to create users in AD via PS7 rather than remoting in to AD and manually creating. It runs through several questions and then my script will run at the end ...
3
votes
4
answers
28k
views
VBS script execution blocked on Windows 10
Posting this question on behalf of GNU Octave trying to troubleshoot execution problems. We've recently had a handful of Windows users install the software and be unable to run the program. Often ...
6
votes
2
answers
4k
views
read in Bash and ZSH
I'm observing differences between zsh and bash when using read on macOS.
With bash this script
echo "characters" | while IFS= read -d '' -n 1 a; do printf %s "$a-"; done
Produces
...
2
votes
1
answer
4k
views
Batch Script to move and rename if existing
I have a folder that contains thousands of .pdfs each file named by a 5 or 6 digit account number. I have a script that will create a folder of the same account number and move the file into it.
...
-1
votes
0
answers
20
views
ForFiles export file
I would like to run the following and hopefully be able to see the total size of all of the data being deleted.
forfiles /p "C:\randomfilepath" /s /m *.* /D -180 /C "cmd /c echo @file @...
1
vote
2
answers
2k
views
Proper date -d "next monday"
I'm trying to write a quick script that figures out the date of the next Monday that isn't today. Although the date command accepts this expression, it appears to interpret it as equivalent to "this ...
6
votes
8
answers
4k
views
Dos and/or Windows versions of Unix SCRIPT command
Back in university, when we had to submit an assignment in CS, we would have to perform a series of steps including running script, date, whoami, etc., and then running our program.
The script ...
1
vote
3
answers
1k
views
BASH Loop Through Variables
If i have a bunch of variables in bash, like this:
foo_1="path/1"
foo_2="path/2"
foo_3="path/3"
foo_4="path/4"
foo_5="path/5"
They all start with ...
0
votes
3
answers
27k
views
Windows 10 batch script to change display settings for specific application
I have an HP Spectre x360 13 laptop running Windows 10. The default resolution for the display is 3480 x 2160, with a scaling factor of 300%.
I need to change the resolution to 1920 x 1080 with a ...
2
votes
3
answers
4k
views
using tr from coreutils for windows
I have to transform contents of file from \ to \\ on Windows in script. So I got Coreutils and tried to use tr \ \\ < file_in > file_out on Windows CMD, but \ in file_out remainde \ instead of ...
0
votes
0
answers
35
views
how to use curl for single sign-on website or page
I've already written a shell script but it's not working. I'm getting an empty response whereas it should first return a token and also it should login then register the API.
That's the task which my ...
1
vote
2
answers
4k
views
Powershell script to compress all child directories and move to archive; keep file structure. Delete originals
I have a task where I need to compress all child directories (child is each day of a month) within each sub-parent directory (Month) and move to an archive folder. Then delete the originals. Also an ...
0
votes
2
answers
5k
views
Command line FTP - delete all files and folders
My script looks something like this:
ftp -i -d -s:C:\Automation\FTP_Config_Files\FTP.txt
My FTP.txt reads like this:
open xx.yy.xx.zz
user
password
lcd Z:\
cd /inetpub/wwwroot
mdelete *
mput *
quit
...
-1
votes
0
answers
33
views
Mounting of drive from script
I have this code:
echo "Mount External Backup @ $externalBackupDrivePath"
for uuid in /dev/disk/by-uuid/*;
do
if [[ "$uuid" =~ $externalBackupDriveID ]]; then
if [...
40
votes
6
answers
46k
views
How to extract a complete list of extension types within a directory?
Within a directory, and recursively within it's sub-directories, meaning every directory within a directory is processed, how do I compile a complete list of unique extensions within the directory?
...
0
votes
1
answer
22
views
Temporarily disabling hardware IO ports for remote connection
I'm using moonlight with sunshine to stream my desktop to my mobile devices for remote access.
Is there a way for a script to toggle the all IO ports, except the ethernet, on and off to prevent direct ...
0
votes
1
answer
29
views
How can I tell in a script, which AzureAD domain a machine is joined to, and which groups it is in, locally on the machine?
I have existing PowerShell and VBScript scripts to tell me things like which AD domain and forest a machine is joined to, which OU it resides in, which site it considers itself to be in, etc. And I ...
5
votes
1
answer
4k
views
run runas in a shell
I'm playing with a Windows 7 VM that I own.
I started a reverse shell with ncat as listener.
I can run commands except runas.
Whenever I try to switch to another user I got prompted for the password ...
3
votes
5
answers
28k
views
"No commands supplied" error when executing a Python script on Ubuntu
I checked out a SVN repository, and tried to python setup.py on my Ubuntu 10.04 terminal, which is a Python script, but I get the following error:
abc@def:~/Downloads/a-read-only$ python setup.py
...
0
votes
1
answer
4k
views
Execute powershell script with different credentials
I am trying to write a script, which asks for credentials via the "Get-Credential" cmdlet
and then executes the logic part with the given credentials.
I know I could write a second script ...
2
votes
2
answers
19k
views
Downloading all files from URL Folder to local folder
I want to download all contents from a url using Windows 10, like
https://example.com/folder
This folder may contain 100 files, and I want to put them all into
C:\backups
I am going to schedule this ...
0
votes
1
answer
7k
views
Make a .vbs running in background visible to be able to cancel it
I have a .vbs-Script that is running in the background endlessly. This script does not have any way for the user to interact with it; a regular user won't even notice something is running in the ...
12
votes
6
answers
9k
views
Is there a general purpose scripting language that I can expect to find on (almost) all Windows installations?
I'm deciding on the programming language I want to use for a simple script that will make a HTTP request checking for avaliable updates, download the update if avaliable and execute a program. On ...
3
votes
1
answer
1k
views
Is there a way to use ebook-convert to split an epub into chapters
Im looking for a way to take a book as an epub file and break it up into a series of smaller epub files for each chapter? I am aware of the other available options with Sigil and the Epubsplit plugin ...
0
votes
1
answer
4k
views
Windows Script to automatically disable and then enable COM port
I have a pc at work which its com port always hangs on boot up. It is windows 7.
In order to get it to work you need to disable and enable the com port manually. This is not an option for the setup of ...
2
votes
1
answer
4k
views
How can I manually generate a fake ACPI lid event from a script in linux?
I'm trying to make sure that my laptop will suspend if I unplug it after the lid is already closed, and I believe that one way to accomplish this would be to simulate an ACPI lid event when the power ...
8
votes
2
answers
23k
views
Stop Bluetooth Keyboard from Sleeping
I got this new keyboard. After being 10 Minutes inactive, the keyboard cuts its Bluetooth connection to save battery. Now when I want to type then, the keyboard needs 3-5 Seconds re-connection time, ...
1
vote
0
answers
11
views
left hand keyboard toggle
I am designing code for a keyboard to be only used with left hand for a stroke patient in autohotkey. I need to use the space bar as a toggle button. So, when space bar is pushed it changes the output ...
2
votes
2
answers
11k
views
How to run a PowerShell script at logon for all (current and future) users with elevated permissions without UAC
I'm building a login script for our company. Some of the things it will do include installing printers, mapping drives, setting wallpapers, etc. Many of these things will require elevated permissions....
1
vote
1
answer
136
views
Is Apple Music (the app, not the service) for Windows scriptable?
Apple used to support COM as API for iTunes. AFAIK, this support has been officially dropped. Now with Apple Music for Windows on the horizon, is there any information available whether, and if so how,...
0
votes
1
answer
69
views
Prevent sending a specific key if I'm pressing other 2 or more keys
I have this mouse with additional forward and back buttons at the side and here's an AHK script that I use with it, It's main purpose is:
If middle mouse button is scrolled up while holding down ...
1
vote
2
answers
109
views
Command Line to Open specific Outlook 365 Calendars
Questions:
How can I open a specific outlook calendar via a command line?
How do I find the values to use in the /select switch?
Work already done:
Using "c:\program files\microsoft office\...
1
vote
2
answers
5k
views
How to run an infinite loop program on startup on a Raspberry Pi without halting boot up
I have a shell script which runs a program in an infinite loop:
#!/bin/bash
while sudo /home/pi/MyCode; do :; done
echo Error with MyCode
I want to set up the shell script to run at start-up (which I'...
0
votes
1
answer
69
views
Linux/Ubuntu/Orange Pi5 retrieve open tabs on Chromium (kiosk mode) via terminal - Powershell
I have a problem as of late where I am developing some PowerShell script to manage and update some digital displays. Please see below for my work in progress (By no means done).
I am struggling to be ...
0
votes
0
answers
38
views
Automated dismounting & mounting of external hard drive
I have an external hard drive for my backups, but to better protect it against ransomware, I want to have a scheduled script after the backup finishes, that dismounts the drive, and then a similar one ...
6
votes
1
answer
6k
views
How to pass node parameters such as '--trace-deprecation' in npm scripts
I am a bit ashamed that I cannot find a good solution to this myself, but alas.
Using npm we generally have a package.json file with a scripts segement for storing the tasks we want our toolchain to ...
0
votes
1
answer
86
views
AHK keywait for multiple keys (missing (SC) (VK))?
I got this function from here :
https://www.reddit.com/r/AutoHotkey/comments/1arcp8q/comment/kr1km61/?context=3
It waits for one or multiple keys to be pressed, But It doesn't accept scan code (SC) or ...
0
votes
1
answer
39
views
how to change the format of the date time of windows from WSH
I want to use Windows Scripting Host to automate my windows instalation and I want from it to change the hour to 24h and the date to YYYY-MM-DD.
Is it possible?
1
vote
1
answer
523
views
More advanced 'Apple Automator' like software?
What I'm looking for is a program similar to Automator or A Better Finder Rename but more extensive / advanced.
In my situation we have two files with the same name, one is a MOV the other an XML. We ...
0
votes
3
answers
4k
views
CMD Line executable of PUTTY calling a script
I have been trying to automate a telnet process using a script of sorts. Whenever I get a hint, it points to PUTTY.
I have downloaded PUTTY and the derivatives thereof, (plink.exe) to get my script ...
8
votes
7
answers
6k
views
How to unwrap 80 character text
Many text filess around Internet are word split before line reaches 80th character. I understand it is desirable by those using 80 character terminals. However I like sending longer articles to my ...
54
votes
9
answers
34k
views
Bash: create anonymous fifo
We all know mkfifo and pipelines. The first one creates a named pipe, thus one has to select a name, most likely with mktemp and later remember to unlink. The other creates an anonymous pipe, no ...
0
votes
0
answers
52
views
PuTTY script reading a list? [duplicate]
Is there a way in PuTTY to run a script that will read a file of names and then answer a prompt of yes (per name)?
It is a Red Hat Linux backend server that I am connecting too.
At times I can get a ...
22
votes
7
answers
36k
views
How to execute a script on sleep, hibernate, resume, and shutdown
I keep alot of my classwork documents hosted on dropbox as well as my personal site for remote storage. This helps alot since I switch between an iPad, laptop and desktop, so there are no worries ...
1
vote
2
answers
3k
views
How to issue an rsh command to run in the background from a batch file?
How to issue an rsh command to run in the background?
Example:
Within a (Windows) batch file I call rsh 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh,
which runs on a remote unix machine. This script ...
1
vote
1
answer
4k
views
Python IDLE not opening when I double click on python scripts on macOS Big Sur
I am trying to run a script with IDLE in Python version 3.9.5. When I have IDLE open and I open the script with File > Open... it successfully opens the script. Likewise, when running IDLE3.9 from ...
1
vote
1
answer
187
views
Writing a batch script to copy files based on date
I have a folder on a local PC that updates files through Dropbox. I have created a batch script that runs through a scheduler each day.
So far it checks to see if a folder is empty (C:\TheGlenFTP\...
36
votes
6
answers
170k
views
How to disable ipv6 on a specific interface in Linux?
Could someone tell me how to disable ipv6 auto-config on a specific network interface in CentOS?
The current situation is:
A PC has two network adapters eth0 and eth1 that are connecting to the same ...
0
votes
1
answer
8k
views
Disabling QoS Packet Scheduler in Windows Server 2008 via script / command line
Currently you can enable/disable "QoS Packet Scheduler" using Windows GUI.
Right-click on the NIC, Properties.
Is there a way to do this from a command line ? or scripting ? I have many windows ...