440 questions
-1
votes
1
answer
59
views
Bulk move the entire subdirectory containing a file to the root folder while preserving its structure
I am looking to bulk move the entire subdirectory containing a file to the root folder. Meaning if there are empty subdirectories in between, they will be deleted but everything beyond the level where ...
1
vote
1
answer
248
views
Batch script to rename files beginning with date format yyyymmdd
I have this batch script, but it is not renaming the files at all.
I have a list of documents that have been named in this format:
yyyymmdd_docname1.pdf
I try to rename all of the documents to ...
0
votes
1
answer
56
views
How to programmatically download a file from a synced SharePoint directory in Windows?
I synced a SharePoint directory to my Windows file system using OneDrive. As seen in the image below, some files are available locally, while others are only available in the cloud:
When I double-...
0
votes
0
answers
90
views
Functions Not Working after compiling ACCDB file to ACCDE
After creating an ACCDE file from ACCDB, several events are throwing up errors - although they continue to work flawlessly in the ACCDB file.
For example, in the ACCDB file - a user has clicked the&...
1
vote
1
answer
739
views
Copy new files from one folder to another folder automatically
I have a problem and don't know how to solve it myself. I haven't found anything on google either.
I have a folder called Trace, in this folder several devices save their trace files. When the devices ...
0
votes
1
answer
104
views
unable to capture the output of a remote command in powershell
I am connecting to a windows device from the host using Open-Device in Powershell.
i have to run a command in remote PC and capture the output into a variable to process further, unable to do so. ...
-1
votes
1
answer
164
views
Exiftool - Batch join tags keywords from JSON to jpg files
I have a thousands of JPG and corresponding JSON files in a Windows 10 directory, along with exiftool.exe:
0001.jpg
0001.jpg.json
0002.jpg
0002.jpg.json
0003.jpg
0003.jpg.json
...etc.
exiftool.exe
...
0
votes
1
answer
494
views
How do I create a powershell script to set default file type (.ica specifically) to open with a .exe located in C:\program files (x86)\
Users must install Citrix Connection Manager to work from home.
Often, their default program to open .ICA files is set to a browser or nothing at all.
Some users don't know how to do this and still ...
0
votes
2
answers
164
views
How to add Double quotes to Array elements in Powershell console?
I need to display all elements of the $FileNames array in Powershell console. I am iterating in a For loop but i cant print double quotes to all Array index elements on the console. Please help.
...
-2
votes
1
answer
1k
views
Can Windows 11 Sound and Display settings be scripted? [closed]
I'm helping a user with a personal Windows 11 computer which, in addition to the built-in monitor, is connected via HDMI to a shared/public television display.
When it comes time to stream a show or ...
1
vote
1
answer
130
views
PowerShell Script to Replace non-HTML Tags
I'm working on a PowerShell script that aims to find lines in HTML files containing angle brackets not belonging to HTML tags. The script should replace said angle brackets with < and >. ...
-1
votes
2
answers
533
views
search a folder recursively to list the file names which contains the string windows
I have a folder which has multiple type of files (word/excel/pdf/notepad). i want to list the which has the string inside the file.
eg:
vijay - list the files only if it has a string anywhere inside ...
1
vote
1
answer
3k
views
Logon scripts are running with admin powershell by default can this be changed?
Trying to configure a logon script (via Group Policy) on a Windows AMI (running on AWS). One of the things the script does is prompt the user for credentials at logon (via $host.ui.PromptForCredential)...
0
votes
0
answers
124
views
Microsoft Excel cannot paste the data. FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
So I have a PowerShell script which copies the data from an source xls file to a destination xlsx file.
Assume I have file named "3 ABC01.xls" and I have to insert the data present in this ...
1
vote
1
answer
400
views
How to automatically set the Application Pool Identity, User Name & Password
Question
How can I automatically set the password of the Application Pool Identity from within a Windows commandline interface or script?
What I have Tried
I have tried to following command in ...
0
votes
1
answer
398
views
Printing borderless with PowerShell script
I'm using a modified version of the script I found at https://monadblog.blogspot.com/2006/02/msh-print-image.html.
It allows you to print by using PowerShell.
Something that I have been unable to ...
0
votes
1
answer
81
views
I need help figuring out where my code is getting hung up at
I have been tasked with coming up with a PowerShell script that I can run on computers at my organization to cleanup old user profiles in Windows.
The goal of the script is get a list of users on a pc,...
0
votes
0
answers
82
views
Remove folder contained in different folders
I solved a similar issue thanks to other user, but not works for folder.
I have these folders:
C:\Users\ge-15\documents\private
C:\Users\te-98\documents\private
C:\Users\ma-98\documents\private
C:\...
0
votes
1
answer
250
views
How can I create backup script for selected tables in Oracle
I am using below script to create backup file but it takes backup of all tables. I want backup of selected tables. how can I achieve this.
imp <username>/<password>@<hostname> file=&...
1
vote
1
answer
18
views
"Object required" - path string unrecognized in windows scripting file
I'm writing a wsf that opens a csv, reads the contents and prints them like so:
<job id="Test_Script">
<script language="VBScript">
Dim objFSO, strSourcePath, ...
0
votes
0
answers
33
views
which script dont need any software setup or config
Apart from Batch script, which script I can use that don't need installation or configuration at client system and can be invoked from windows visual studio?
powershell python etc. needs installation.
...
1
vote
1
answer
102
views
Create Directory and Copy files from different directory (shared location) in production using Windows batch scripting
I have a production mapping where the folder does have more files to copy from one shared location to the other location.
Location A: D:\UK\UK0623\Path\Temp_Variable\ORIGINAL\test1.pdf,test
2.pdf,........
0
votes
1
answer
180
views
Getting PowerShell Script Location at Run Time in PowerShell Command line
I am running a PowerShell script and calling $MyInvocation.PSCommandPath within the script and it returns null.
The script is meant to be run within a PowerShell Console because it has command line ...
0
votes
0
answers
45
views
Needing to read data from Excel and output it into EMS command
I am currently working on a project to help me with a job at work. Currently we are copying and pasting a command over and over and over and over (1800 times to be exact) into a mail server similar to ...
0
votes
2
answers
237
views
Scanning Log Lines for Specific Destination IP Addresses and Extracting fields
I am reaching out to seek your expertise and assistance with a task I'm currently working on. I have a text file containing log lines, and I need to scan these lines for specific destination IP ...
1
vote
0
answers
173
views
"Unsupported Pattern" Exception When Executing Script, Not in Interactive Mode
I am attempting to perform a quiet uninstall of a program using PowerShell. Winget is used to initiate the uninstall process. The UIAutomation features are used press a single button in the UI that ...
1
vote
0
answers
28
views
Is there a way to assign display changes to a hotkey in Windows?
I'm a digital artist working from home.
I have two monitors: one is an actual 1920p Philips monitor and the other one is a 1920p Huion Kamvas drawing tablet.
I use the tablet both as a drawing surface ...
1
vote
0
answers
320
views
Try to Changin the resolution of Monitor through Powershell script when multiple systems connected on hub switcher with single Monitor screen
I am working as an Automation engineer and am using the automation tool which only supports Head state(UI should be visible) which automatically requires Screen resolution in the perfect state.
So to ...
0
votes
1
answer
837
views
How to create multiple SMB shares with different share names mapped to different paths in PowerShell
I'm trying to figure out a way to script in PowerShell the creation of multiple SMB shares on a file server with different share names pointing to different paths. What I mean is having a variable ...
-2
votes
1
answer
59
views
How can I merge this code so all stages use $RootPath? [closed]
I'm not a beginner to scripting with PowerShell and have discovered just how powerful and amazing it truly is. I get confused with some things though so I am here seeking help with a few things with ...
1
vote
1
answer
102
views
How to rename a workbook other than using (Name) and (FileSystemObject. MoveFile)?
Suppose I have a workbook on my desktop with name Test.xlsm and I need to rename it to Test2.xlsm in the same path.
I can rename it using Name statement as the following :
Sub Rename_using_Name()
...
0
votes
4
answers
295
views
SaveAs a file and move it’s icon on Desktop to the same old position of the original file
I have used the below code to a workbook (SaveAs) and then delete the original file.
The Windows OS put the new created file on the first left vacant space on My Desktop.
What I need after using ...
0
votes
0
answers
113
views
Copy Single File to Destination Folder if Exist else Copy to Another Folder
I am trying to copy a file from one location to another. There are two possible source destinations on the computer I would like the script to check if the folder exists (i.e. -eq 'True') if doesn't ...
0
votes
0
answers
182
views
Restore Bacpac File in SSMS Using Powershell or Command Line in Windows
I have to restore bacpac file into SSMS in local machine using a script or a command line,
Can someone please help me with this?
1
vote
1
answer
399
views
Batch rename files in Windows 10
I have a folder in which I need to rename all of the files to replace a string with another string:
File 01 (Something) ABC.txt ---> File 01 - ABC.txt
File 02 (Something) DEF.txt ---> File 02 - ...
3
votes
1
answer
3k
views
Automatically answer “yes” to a prompt in Powershell?
New to PowerShell scripting. I am trying to run the following code in PowerShell and make a script out of it:
md c:\\HWID
Set-Location c:\\HWID
Set-ExecutionPolicy -Scope Process -ExecutionPolicy ...
0
votes
0
answers
82
views
PDF extract specific pages & merge with new filename
I have 2 pdf files (templates) from which I need to extract 1 page each and save as a combined pdf. Each pdf has a filename with a different 3 letter location indicator (e.g. LOC) for each of the ...
4
votes
1
answer
167
views
PrintOut Code Works On PowerShell v 5.1, But Not On 7.3
I am trying to print parts of several docx files. The code below works in Windows PowerShell 5.1, but not in PowerShell 7.3. I would like to understand why and help updating the code so it works in ...
1
vote
1
answer
71
views
Edit xml file's DefaultValue using powershell script
I want to edit the DefaultValue for the Property name = "UseThis" using PowerShell script.
Xml file :
<?xml version="1.0"?>
<ConfigFile xmlns:xsd="http://www.w3.org/...
-1
votes
1
answer
82
views
Script to extract/cut contents from a log file into a new file
I have a log file that captures data and timestamps it, but it doesn't have a date stamp. So it ends up looking like the below with the newest information at the very bottom.
[01:10:01:943] numbers/...
0
votes
0
answers
822
views
Import task scheduler xml file using cmd or powershell
I have exported task scheduler task in xml format and now i want to import it into different pc using cmd or powershell or any script only.
How can i import task scheduler xml file into task scheduler ...
0
votes
1
answer
1k
views
How to move backup files from windows server to AWS S3 bucket? But I also want 30 days backup file locally
I have some MS SQL backup files in different directories on windows server. I want to move all the files from different DB backups to S3 bucket.
Can you please suggest what would be the best approach?
...
0
votes
1
answer
374
views
How to modify created output using Microsoft PowerShell?
I've created a code in PowerShell to search through files to find lines containing null values '000' and create a new file that replaces these values with a user input. I've included the code below ...
-2
votes
1
answer
1k
views
Remove audio streams from multiple videos at once
I use ffmpeg -i input -map 0 -map -0:a:2 -c copy output to remove audio stream from a signle video. How can i apply this command to more than one video without duplicating the command. I am on windows....
1
vote
2
answers
5k
views
Activating Python Virtual env in Batch file
I'm trying to make a batch script (called run_windows) that check if the python virtual environment exists and if not, create it then activate it, install the requirements and finally run some python ...
-2
votes
3
answers
589
views
batch script to read multiple files and count commas on each line
I am a newbie in batch script and I am trying to achieve the following:
loop through multiple files, count the # of commas on each line then remove extra commas if it is greater than 10. I can only ...
-2
votes
2
answers
521
views
Lua Sleep and Loop function problems
So my script currently stops on conditions
if profit >= 0.1 then
stop()
end
i want to implement this code into mine so after the target satified it will sleep for 30 secs and then restart my ...
0
votes
1
answer
569
views
How to print process ıd in event log?
Im trying to get process id from my Get-Eventlog. I can not parse the process id from the message. How ı can get it from there ? I tried With Select string -Pattern but it did not worked. My ...
1
vote
0
answers
205
views
Inno Setup - Test DB connections with a Windows script
My goal is to be able to test a DB connection from Oracle, MySQL, PostgreSQL, SQL Server, etc., ideally without installing any drivers (probably not possible).
I'm working on Inno Setup. The user ...
0
votes
2
answers
3k
views
How do you enable excel add-ins for all users using registry (HKLM)?
I'm trying to enable an excel add-in for all users in a given lab (Office 2019 is installed). The path to the add-in's "OPEN" string in the registry is HKEY_CURRENT_USER\SOFTWARE\Microsoft\...