Click here to Skip to main content
15,891,657 members
Everything / Scripting

Scripting

scripting

Great Reads

by Simon P Stevens
How to set the current directory correctly when running batch scripts as administrator
by Mr. xieguigang 谢桂纲
The ShellScript is originally developed for the debugging of my "genome-in-code" virtual cell simulation engine, but now it becomes a script language for a .Net program.
by Dev Leader
With this post, we’re still just scratching the surface of what’s doable when integrating Python and C#.
by Gaurav Aroraa, Mahsa Hassankashi
In this article, we will discuss how to create npm packages/modules

Latest Articles

by jespa007
A simple script engine for C++
by Łukasz Bownik
Smallscript is a little scripting language inspired by Smalltalk syntax.
by Bruno van Dooren
How to clean up user profiles on a computer
by Mr. xieguigang 谢桂纲
R# language is a kind of R liked language implements on .NET environment

All Articles

Sort by Updated

Scripting 

27 Feb 2024 by jespa007
A simple script engine for C++
22 Feb 2024 by Maq47
Okay, I am seriously facepalming right now. Easiest solution ever. Just add the value directly to every single result in Notepad++: Find: (0x[0-9A-F]{5}); Replace: \1 + 0x617A0; I have no idea why I was trying to edit the numbers themselves...
22 Feb 2024 by Dave Kreskowiak
I don't know of any tools that will do this, the problem being the addition of a number to another in the replacement value. You will probably have to write your own tool to do this. This is mostly going to be reading a text file and string...
22 Feb 2024 by Maq47
Hello, I have a C# file that contains 591 5-digit hexadecimal numbers in the format '0x?????', and I wish to replace them with their number plus a set hexadecimal number. How can I do that, even if I have to download new software? I really do not...
3 Jan 2024 by Łukasz Bownik
Smallscript is a little scripting language inspired by Smalltalk syntax.
6 Dec 2023 by Alina Matchey
I have written a pinescript strategy, it compiles fine and looks like it is entering the trade correctly as all the conditions seem to be met. However, the trade is exiting when no conditions are met. The exit conditions are just the opposite of...
7 May 2023 by as7951
Experts, Need your support for this awk script. we have only one input file, all these column 1 and column 2 are in same file and have to do lookup for values in one file(column1 and column2) but output we need in another file Need to grep row whose string contains 9K in column 1 and then grep...
7 May 2023 by Member 10601191
/^9K/ { kees[$0]; next; } { for ( key in kees ) { # # is it part of the key ... # if ( match( key, $1) ) { if(...
9 Mar 2023 by Bruno van Dooren
How to clean up user profiles on a computer
19 Jan 2023 by Krishna Chaitanya Bezawada
I have an VBA code in an excel workbook, which performs several actions like copy the data in the worksheet and paste it to different worksheets in some specific format for further processing by our software. If RunPLS.File_Exist = True Then ...
19 Jan 2023 by Ralf Meier
I would suggest you to work with specific adressing of the Workbooks and Sheets. So you could be sure that you are all time inside the right Workbook / Sheet. Here an example what I have used : Dim oWB, aWb As Workbook Dim aSh As Worksheet ...
15 Nov 2022 by ksravanikusuma
Creates 25 empty (0 KB) files. Use the touch command. The file names should be , , , and so on. Design the script so that each time you run it, it creates the next batch of 25 files with...
15 Nov 2022 by Richard MacCutchan
If you are expecting someone here to do your work for you, then I am afraid you will be disappointed. If you do not know how to write bash scripts then take a look at bash(1): GNU Bourne-Again SHell - Linux man page[^].
14 Sep 2022 by Member 15767385
I'm creating a simple time tracker for time and motion study purposes in Google sheets. The current code that I'm using only records start time and end time as shown on the screenshot below. Here's the Google Sheet tracker: Tracker - Google...
3 Aug 2022 by Mr. xieguigang 谢桂纲
R# language is a kind of R liked language implements on .NET environment
11 Feb 2022 by DoingWork
I want to start 2 applications with one shortcut. One application is GUI based while other is shell based (Terminal=true in .desktop file). What I have tried: For this goal, I created a file name **Starter** having following script in this...
7 Feb 2022 by Michael Sydney Balloni
Replace your nasty .bat files with friendly mscripts for clean and powerful command line operations
21 Dec 2021 by Deniskate
Hello gyus, I have a folder which has many text files with tables (delimited with fixed width) this folder is updated daily 3 times. I want a batch file script or any way to move these text files into microsoft access database file .mdb...
21 Dec 2021 by CHill60
I used to do this. 1. Write some VBA to read the contents of a text file into a table. There are many examples on the internet e.g. VBA procedure to import csv file into access[^] 2. Write another VBA function to list the files in the folder...
14 Nov 2021 by A v Nov2021
Input in a text file: a=2*8 b=3*9 c=4*8 d=5*9 e=a+b f=c+d g=0*6 h=1*7 i=e+g j=f+h output=i+j Desired Output : output=(((2*8)+(3*9))*(0*6))+(((4*8)+(5*9))*(1*7)) What I have tried: #Logic from internet. D = dict() output = None with...
31 Aug 2021 by Mehrez Kanzari
I'm trying to implement the monitor function in Python. This function must display at regular interval the date followed by the return of the "measure" function. It stops after `cycles` executions and the interval will never be less than 1. The...
26 Aug 2021 by OriginalGriff
Read the question again: you have to display a message at regular intervals. So ... the first thing you will need is a loop of some form ... Read it carefully - it tells you exactly what to do, and the code you show doesn't fit it at all!
31 Jul 2021 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
29 Jul 2021 by W Balboos, GHB
ALL of my websites are only written using "classic" PHP and JavaScript. This includes an infrastructure that underpins the majority of activity for a 500-employee company. I keep away from the various frameworks - code-candy of the week - and...
29 Jul 2021 by Xarzu
PHP and Classic ASP are server-side scripting languages. What is wrong with having a website written in this instead of the trendy JavaScript Frameworks like React, Angular etc.? If memory serves me correctly, there is an issue with security...
10 Jul 2021 by jespa007
Example game engine by using SDL2 and ZetScript
8 Jun 2021 by Stefen20000
Hi, I am new to shell scripting and MQTT. I need to publish a `JSON file` using `MQTT`. We can do it by storing the JSON contents in a `shell variable` and then using it in MQTT publish command. But it is not working for me. Please help me out...
8 Jun 2021 by QuantumPlumber
I think the outer enclosing set of double quotes in your var1=.... statement might need to be single quotes (I assume the triple-quotes are just there for show and not what you actually typed). I have no familiarity with mosquitto but have had a...
21 May 2021 by webmail123
I have a batch file that is scheduled to run after every half hour in the windows scheduler. The batch file will create a text file and it will write some data into a text file. In that, I want to run a command line to count the number of folders...
21 May 2021 by l o o l
You can get the value in a variable without creating/read a file and in a line.. @echo off >"c:\demo.txt" ( echo # Title to be displayed echo # Purpose to count the directories in a folder for /f %%i in ('dir/b/ad...
3 Dec 2020 by Guru Deshmukh
I am unable to list the AWS ECR repositories through boto3 script. Can anyone help on the this issue. What I have tried: import boto3 client = boto3.client('ecr') response = client.describe_repositories( registryId='string', ...
3 Dec 2020 by CHill60
If that is really your script then you are looking for a repository with registryId "string" - I doubt that there are any repositories called that. You also want a repository with a blank name, and a previous call has returned a nextToken of...
17 Oct 2020 by OriginalGriff
Repost: deleted. Answers do not change just because you don't like them. Follow the links your were given last time, and start learning.
8 Oct 2020 by OriginalGriff
We can't help: we have no idea what might be "messed up" about an excel sheet, and no way to tell what it is in your specific case - remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to...
16 Jun 2020 by webmail123
I more than 200K folders that I need to move from one network location to another network location. I want to do it with Robocopy. I need help with 2 things 1. I want to move folders starting with string '19' 2. I want to move folders created...
16 Jun 2020 by Richard Deeming
robocopy | Microsoft Docs[^] There is no support for wildcards in the source directory. You'll need to use a for loop to issue a separate robocopy command for each matching folder. FOR /D %G In ("\\networksourcepath\path\19*") DO robocopy %G...
28 May 2020 by F-ES Sitecore
Does the text output reflect what you would expect? Your fuel system code only sets the max value of the slider if startFuel > maxFuel, are you setting the values in the editor for when that condition isn't true? Also in ReduceFuel you set...
28 May 2020 by CodingGreek
I'm a beginner learning to code with Unity as well. I want to set up a Fuel System so that when the car moves the Gas is used up. But my UI slider (that shows the fuel gauge) just doesn't seem to be working. Please help on the below 2 scripts: ...
12 May 2020 by Richard MacCutchan
Try this : @echo off echo # Title to be displayed echo # Purpose to count the directories in a folder rem save the count in a variable to use below dir /b /ad "C:\Users\rjmac\Documents\Code" | find /c /v"" > zz set /p count=
14 Jan 2020 by honey the codewitch
Easily add scripting support to your apps using Microsoft's active script technology
4 Jan 2020 by Member 13926859
hello every one i spend a lot of time creating manually a windows form application and class in visuel studio that contains connection . so i want to creat a script that i can run it with cmd that creates me a new project in visual studio with windows form and a calss . i don t know houw to...
4 Jan 2020 by Richard MacCutchan
You can easily create your own project templates in Visual Studio. See Project and item template parameters - Visual Studio | Microsoft Docs[^].
4 Jan 2020 by OriginalGriff
Try this: Adding your items to Visual Studio default files[^]
4 Jan 2020 by phil.o
Maybe that can give you a clue for starting: Extending Projects[^] Devenv command-line switches[^]
25 Jul 2019 by as7951
Experts, Need your support for this awk script. we have only one input file, all these column 1 and column 2 are in same file and have to do lookup for values in one file(column1 and column2) but output we need in another file Need to grep row whose string contains 9K from column 1. When found...
3 Jul 2019 by Prakash Singh
Resolution of Security rule has invalid Port range issue
31 Mar 2019 by siddiqueraza
What is the difference between Bootstrap and Angular JS, in term of advantages and disadvantages for their usage in web applications.What I have tried:What is the difference between Bootstrap and AngularJS?
10 Feb 2019 by Member 14144306
So i have a coded UI test that works fine. I've create a batch file script so that i can run in windows task scheduler. It keeps showing "Failed" What I have tried: cd / cd "C:\Users\alish\source\repos\CodedUITestProject6\CodedUITestProject6\obj\Debug\CodedUITestProject6.dll " @echo off set...
10 Feb 2019 by OriginalGriff
Probably, it's a permissions problem: the Scheduler does not run under your user ID, so it won't have access to your files. Try moving the data and DLL files to a different folder - "Tests" hanging directly off the root is good - and set the access permissions on the Tests folder to all for...
9 Feb 2019 by Member 14144306
So I have this localhost website that shows gridview of images that can be downloaded (link button used). I created a batch file and wrote some script to import it in Windows Task Scheduler. It works fine. But now, i'm trying to make the script do the clicking. Currently, it just runs/ open the...
9 Feb 2019 by Dave Kreskowiak
You're going to have to write an application to load the web site and do the "clicking". There's nothing you can put into a batch file that will click a link.
18 Dec 2018 by TheChewingTurkey
Hello, OriginalGriff made me realize I was making things more complicated then I needed. What I ended up doing is fixing the python script generating the csv file: from gpiozero import CPUTemperature cpu = CPUTemperature() from time import sleep, strftime, time with...
18 Dec 2018 by TheChewingTurkey
Hello, I'd like to take a .CSV file that is currently formatted as: 2018-08-16 06:06:40,35.938 2018-08-16 06:09:14,35.938 2018-08-16 06:24:14,34.862 2018-08-16 06:39:14,34.862 2018-08-16 06:54:14,35.399 and have an output like this: ("2018-08-16 06:06:40","35.938") ("2018-08-16...
17 Dec 2018 by OriginalGriff
Use string.Split to break each line of the input in two: string[] parts = input.Split(','); Then use string.Format to "bolt them together" again: if (parts.Length == 2) { string output = string.Format("\"{0}\",\"{1}\"", parts[0], parts[1]); ... Or even like this: if (parts.Length == 2)...
17 Dec 2018 by Wendelius
Based on the question title it sounds like you're trying to build INSERT statements with literal values based on the data in a CSV file. If this is the situation, I would advice not to use the data from the CSV as is since this would leave you open to SQL injections. One very simple way to...
21 Oct 2018 by Richard MacCutchan
Go to Control Panel -> Update & Security -> Windows Update, and you can do it from there.
21 Oct 2018 by P. Sachin
I am looking for batch file which will run and uninstall the Security update & Microsoft windows update from my server machine which I don't want to be there. As my server is supporting old technology app I don't want latest update after May 2018. Is there any way to do it. What I have tried: ...
15 Oct 2018 by #realJSOP
This CP article might help: Compiling C# Code at Runtime[^] You could essentially create a CSharpScript app that loads a text file that contains C# "script" code and compile that script at runtime. You could also write pre-compiled plugins for your script runner app, and specify the DLL...
15 Oct 2018 by Patrick Skelton
I have what I thought would be a dead easy question to find an answer to. Having really, really tried to get on with PowerShell, I find its syntax to be arcane to say the least. I don't doubt its power but I'm not a sysadmin and I don't do batch scripting very often. So every time I come back...
26 Sep 2018 by shivam gohel
So, I am currently making an automation software for a client. It uses selenium and chromedriver. Now the chromedriver varies from os to os. Macos, linux and windows have different files of chromedriver, So if i write some code that just is independent of operating system. How should i do...
21 Sep 2018 by Richard MacCutchan
OK, to continue from my earlier message: 1. "Yes, I did try "redirection" but it did not work as expected." This is one of the most frustrating comments that we see in a question. We have no idea what you did expect to see or happen. And we have no idea what did happen. Without a clear...
21 Sep 2018 by Vaclav_
I just started using bash scripting language and having trouble understanding "command substitution " and " redirection". I am using bash man very frequently and know something about this specific subject. Here is an example of using command substitution. I used command "sed" to find line...
30 Aug 2018 by Richard Deeming
Using PowerShell: $files = Get-ChildItem -path C:\Data\ -filter *.txt foreach ($file in $files) { $content = Get-Content $file if ($content -match "99999999") { $content = $content -replace "99999999", $file.BaseName Set-Content $file $content } }
30 Aug 2018 by suniti dinesh
i want to replace the string in a file with file name. I am having 3000 files with different file names. Is there any way i can do with batch script I am completely new to scripting. please help me on this eg: I am having a file name as 12345678.txt inside the file I am having some records...
17 Aug 2018 by Dave Kreskowiak
This is quite a bit off-topic for this site. You're best bet is going to be forums dedicated to Cisco routers. There is no such thing here.
17 Jul 2018 by Gerald McAuley
Frankly, I'm lost in how to approach using the API for: https://www.npmjs.com/package/broken-link-checker For instance, the doc give this example: var htmlChecker = new blc.HtmlChecker(options, { html: function(tree, robots){}, junk: function(result){}, link: function(result){}, ...
13 Jun 2018 by Ice-Capped Mountains
AAA URL Shortener URL Here: function generatePath id="url" (path = 'url') { let characters =...
22 Apr 2018 by JohnLeitch
This article details how to make .NET applications scriptable with Aphid, an embeddable scripting language.
1 Apr 2018 by JavaScrptMaster
I am trying to write a Power Shell script which will check the connection status of paired Bluetooth devices in a certain interval (15 sec) and if found the device is out of range then will lock the users system. What I have tried: In the following code I am not able to figure out how to list...
25 Jan 2018 by Member 13643868
Hi I have an XLS file that contains (Names, Phones, Emails) I need to import that information into a letter file in TXT. is there a script or a program could do that? What I have tried: I'm not a computer guy, so please need your help
25 Jan 2018 by OriginalGriff
Loads. If you aren't "a computer guy" then I'd suggest you start with Word: Mail merge using an Excel spreadsheet - Word[^]
28 Dec 2017 by Rubin Liu
A quick look around the different styles in the Ring programming language!
16 Nov 2017 by pavithirakc
I am trying to build a system, which when given an input, would return relevant specific information about it by scraping the web (For example: given a software name, output information about its releases). How to go about building a scraper for such a system? What I have tried: I have...
19 Oct 2017 by Patrice T
I guess you are looking for PHP 5 Tutorial[^] This site is a good tutorial for most web related techniques: W3Schools Online Web Tutorials[^] [Update] Quote: These are the actions: - Fill a date field by picking a date from calendar - click on buttons to navigate through the website - Fill...
15 Oct 2017 by Member 13408460
Hi, I am working with a web-based booking system. I'd like to write a script that will spare me repetitive manual actions that I do everyday. I am new to such kind of programming, and I was hoping you could tell me a bit about this type of programming. What language / tool should I learn? Could...
27 Sep 2017 by Member 11052303
Write an algorithm which can increase the size of data passed into it without adding any redundant bits. (Think it as opposite of compressing the data) Make another algorithm to reverse the process above so we can get original data. write python scripts for both which at least can extend...
27 Sep 2017 by Arthur V. Ratz
Probably, this article would be interesting to you: Implementing the Huffman adaptive algorithm to compress 256 colors depth graphics images[^]. If you've got any more questions, just feel free to post them as the reply to my solution that comes here. :)
10 Sep 2017 by Member 13330589
Hello I am scripting in Roblox and I want to figure out how to write a line to execute this so I can change my money in-game. I have a Explorer that lets me open up the files and I can change it, but I want it in a script I can execute so I don't have to keep going in manually and changing...
10 Sep 2017 by The Chaotic Void
Welp Exploit Kids here. Anyways Here are the few things I need you to describe: [-] What is the class of the object your trying to execute. [-] Have you used RemoteSpy?
25 Aug 2017 by B.Sudhir
1. I was trying to execute a Bash Shell Script from any directory in the system. for this I need to make it available to execute anywhere in the system. 2. I also mistakenly added wrong path which I wanted to delete but its not happening. Please help. What I have tried: 1. I've added the...
25 Aug 2017 by Jochen Arndt
To change the PATH environment variable you should export it (the export command will write it to the environment): PATH=$PATH:~/bin export PATH Without the export command, the variable will be only set for the actual shell session but not for commands executed in that session or other shell...
25 Aug 2017 by Richard MacCutchan
1. You should use the absolute path to your bin directory, or a defined variable such as $HOME, rather than the tilde (~). 2. You should post your question to the writer of the SO answer.
17 May 2017 by Member 13207333
We have 2 tables Tables : ApplePhone and AppleGear Table Structure:ApplePhone Id Phone 1 6s 2 7s Table Structure:AppleGear Id Gear 1 ear 2 watch Now we need to write the above table data into flat files with | delimiter. 2 O/p File should be: ApplePhone.dat Id|Phone 1|6s 2|7s ...
17 May 2017 by CHill60
You need to learn how to research topics. Have a look at these resources: Using Powershell to export SQL table data to text files[^] 8 Ways to Export SQL Results To a Text File - SQLServerCentral[^] World of Whatever: Powershell export query to csv[^] All of which I found by pasting the title...
3 May 2017 by NightWizzard
There are two simple ways to solve this: 1) if it is correct that each map ends with the key word 'exit' and if this key word won't occur in other positions within a map, you may read the complete file content into a single string, then use the split method to turn the string into an array using...
1 May 2017 by Member 13163682
i have set of MAP in text file as below. map alias elr72_511 type regular byRule roles replace admin to owner_roles comment Converted_from_elr72_rule_31 to 1/2/x29,1/3/x27 from 1/4/x5..x6 exit map alias elr72_582 type regular byRule roles replace admin to owner_roles comment...
3 Apr 2017 by Member 13036251
I am in the process of searching for an existing tool or writing my own. I've even considered writing it a powerful scripting language; PowerShell comes to mind. If you were to use a powerful script or application; what would it be? Also, command line option is preferred, if possible. Also,...
3 Apr 2017 by Dave Kreskowiak
Windows multi-file search and replace[^]
22 Mar 2017 by luigidibiasi, binterlandi
Build a realtime visitors counter with AJAX and a server-side language.
26 Feb 2017 by Dave Kreskowiak
Unless you own and operate the site, no there is no way to fix the script.
22 Feb 2017 by Graeme_Grant
Here is a resource that will help you: Top 10 DOS Batch tips [^] - see tip 9This Command Reference[^] will come in handy too. :)
22 Feb 2017 by TheSniper105
i want to rename single file specific extension "*msi" to replace current version with another versionfor example file name is "test_1.2.6.msi"want to be renamed using variable i specifiedif i entered 2.3.9 as new version file should be renamed to "test_2.3.9.msi"here is...
8 Feb 2017 by Mr American Pie
I have been trying to figure out this but with no success . What I am trying to do is to keep the old text while the script adds the new text below the old text.public GameObject Text_Object; private Text textComponent; void Start () { //gets the text UI Object in...
8 Feb 2017 by Patrice T
Richard gave you a solution, but you need to learn JS much deeper.http://www.w3schools.com/js/default.asp[^]W3Schools Online Web Tutorials[^]
8 Feb 2017 by Richard MacCutchan
textComponent.text = textComponent.text + "Hey";
16 Jan 2017 by Member 12952937
I use DCUTerm to reset brake system counters, at the moment I have to connect to each individual IP, run the script, and move to the next IP. I would like to be able to plug into the IP port and run the scrip so it cycles through a list of predetermined IPs using the same method. Can someone...
16 Jan 2017 by Dave Kreskowiak
This is not a script but a configuration file that is loaded by your terminal app. There's nothing to change here.You'd have to write a script from scratch to do what you're talking about, IF your terminal app supports doing so. I have no idea if it does or how to do it.
22 Dec 2016 by Member 12917493
Hello everybody,I have been working with Debian for a couple of months for school and because it seems really handy to work with. but now I want to make a game for in the terminal. A Higher or Lower card game (also for school but I wanted to make it before I was given this task). You have to...
22 Dec 2016 by Jochen Arndt
I did not checked all the code but this looks suspicious:if [ "$score" -ge 1 ]; then Number=$(($RANDOM % 52)) Gokkaart=${KAARTEN[$Number]} oldNumber=$Number echo "De kaart is $Gokkaart2"fiYou are assigning a new random number to $Number. So the old number is no longer...
29 Sep 2016 by CPallini
Well, you may hack the more by learning how to properly use Q&A.