Scripting Languages

28K

Solutions

21K

Contributors

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello experts,

The following script allows me to add a specific character at the beginning and end of a selected text:

;====================================
;EE Code
;====================================

!^c:: ;code
Send, ^c
Sleep, 50
ClipWait,1
If (ErrorLevel=1)
{
  MsgBox,4144,Error, No text appearing after one second
  Return
}
ClipboardVar:=Clipboard
Clipboard:="[code(string))]" . ClipboardVar . "[/code(string)]"
Sleep, 50
MsgBox,4160,Success,Your clipboard has been properly copied., 2
Return

Open in new window


I would like to take it as a reference to add specific character (-) at the beginning of the various lines of a selected text.

Example of a selected text:
Line 1
Line 2
Line 3
Line 4

Result:
-Line 1
-Line 2
-Line 3
-Line 4

If you have questions, please contact me.

Thank you for your help.
0
Bitbake is a python program. It was downloaded from:  https://github.com/openembedded/bitbake
bitbake 1.40.0 branch was selected for download.

What instantiated class ConfigParameters(object)?  I see that __init__ or constructor was executed but exactly what python code instantiated this class?


object created
filename:  cookerdata.py
class ConfigParameters(object):
    def __init__(self, argv=sys.argv):
        self.options, targets = self.parseCommandLine(argv)
        self.environment = self.parseEnvironment()

Open in new window


filename:  bitbake
if __name__ == "__main__":
    if __version__ != bb.__version__:
        sys.exit("Bitbake core version and program version mismatch!")
    try:
        sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
                              cookerdata.CookerConfiguration()))

Open in new window

0
Dear experts

I would like to export a table from MSSQL to a csv file, using query, anyone know how?

And I also need to know, if its possible to import this csv file to another MSSQL dB?

Thanks
0
BitBake is a Python Program.  I downloaded BitBake from  https://github.com/openembedded/bitbake.  I selected branch version 1.40.0 and downloaded the zip.  
At least some of the source code is in bitbake-1.40.0/bin  and  bitbake-14.0.0/lib folders.

I can insert print statements to navigate source code.  Is there alternate way to navigate python program such as bitbake?
0
Dear experts

Please provide a solution for me, I got a MSSQL that got tables:
test1_201911110
test1_201911120
test1_201911127
test1
Those are table names.

Every month we need to delete test1_201911110m test1_201911120 and keep test1_201911127 and test1. The table names are diffirent each month. last month it was
test1_20191010
test1_20191020
test1_20191027
test1

Is there a automatic way doing it? Thanks
0
I now use an app that generates a 'work' file each time its run. The work file is always generated with the same treename.  Now I run a new program that will process a set of the 'work' files... But only if I remember to save&rename each 'work' file before running the app.

So I am interested in a new program that runs continuously on Windows( 7&10) that checks for a new version of the work file (pauses/sleeps for 30 seconds, then checks ) .  If this program finds a new work file, the program copies the file to a particular directory, and removes the work file from the app's directory.

I would have this program start up when Windows is started.  This program would retrieve its parameters (treename of target work file and the save directory) from a 'INI' type file. The name of the INI file would be a command line argument or queried to the user.. All INI files are stored on one base directory This allows me to have 2 or more instances running at the same time.

Are there scripting languages that run on Windows?  If not, my computers do currently have Python running.

Thanks,
Don OHara
0
I haven't worked in bash for many years. Someone at work had a problem with substituting a string in a file with a string that included a space. Here is what is in the .bashrc file.
alias frf='set -o noglob;_frf'

function _frf
{
    \echo “Replacing $1 with $2 in all $3 files…”
    \grep -li $1 $3 | \xargs -tI@ \sed -i 's/'$1'/'$2'/g' @
    return
}

Open in new window

The files 1.txt and 2.txt are identical with the contents:
this is a string

Open in new window

The following gives no problems:
frf ring rung
frf rung ring
Then diff 1.txt 2.txt shows no differences.

But the following gives an error:
$ frf ring "r\ ing" 1.txt
“Replace ring with r\ ing in all 1.txt files…”
sed -i s/ring/r\ ing/g 1.txt 
sed: -e expression #1, char 9: unterminated `s' command

Open in new window

I have a couple questions about his alias file.
what does this mean: set -o noglob ?
Why are there '\' before the echo and the grep ?
How to modify this alias to enable escaped spaces?

Btw, what is wrong with diff *.txt which gives error "missing operand after '*.txt'" ? Never had problems like this before. diff 1.txt 2.txt is ok.

I also tried this line which was worse:
find . -name "$3" -exec sed -i 's/$1/$2/g' {} \;

Open in new window

0
Hi,

I want to run a script that runs Choclatey (https://chocolatey.org/docs/installation) and other stuff in 1 go.
Both Choclatey and the script need the Powershell to be started in admin.

So I can run a Powershell in admin mode: powershell -Command "Start-Process powershell.exe pathtomyscript" -Verb RunAs but then Powershell says execution is not allowed.
Myscript contains
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Then other stuff, like choco install chrome etc

Please advise: howto run the cmd (administrator popup can show, no problem), then runs my script (preferrably  I don't need to give a path): installs choclatey and then my software.
J.
0
In an AHK Script I would like to call Excel to use a specific workbook and sheet. I'm unaware of what the com objects are for those things.
0
I would like to loop through columns in Excel via AHK script.

XL := ComObjActive("Excel.Application")
Columns := Object(1,"A",2,"B",3,"C",4,"D",5,"E",6,"F",7,"G",8,"H",9,"I",10,"J",11,"K",12,"L",13,"M",14,"N",15,"O",16,"P",17,"Q")
For Keys, Value In Columns
Row := 3
Loop, 10
{
    XL.Range(????? . Row). Value := "Test" A_Index
}

Open in new window


I'm having trouble with the how to call the column and loop to the next column. The goal in the end is to copy cells one at a time and assign a variable to each cell in a row and then loop through that on the following row.

So...
ColumnLoop
B3 Copy to clipboard Paste to Variable appended with A3
C3 Copy to clipboard Paste to Variable appended with A3
through to Column H
RowLoop
Should do the same as above but on Row 4
0
Hi,

In a PowerShell script I have many variables and I need to run the script many times.

I want to make sure the variables cache are clear every time I execute the script without need to close and reopen the script.

How can I do that?
0
Is React as Object Oriented as Angular?

I've worked with Angular enough to fall in love with its modular design and how a new control that works on one web page and easily be dropped onto any web page in the project.

The way it limits the scope of the CSS, HTML and Javascript to the specific problem at hand, in my eyes, if what makes it so fast.

How about React?

I have no experience with React, but hope to see some coded snippets to explain how you'd connect logic, page placement and styling. (and anything else that should be considered when choosing React over Angular)

Also, any predictions on adoption rates? If a technology is flagging, I may not be as interested...

Any new technologies which may rival Angular and React?


Thanks
0
Trying to create a VB script that will prompt a user to put input data, this data then will populate into parts of a url so that it goes to the correct page.

Managed to get a prompt box for user data to appear but i can get this data to populate in the middle of a URL. i'm sure the code is wrong and needs to be change or is there an easy way around this?
Code below, basically where the strAnswer is in the url i need the data to populate.  Any suggestions would be nice :)

strAnswer = InputBox _
        ("Enter your Data here","This is your Case Number")

Set objExplorer = CreateObject _
    ("InternetExplorer.Application")

strURL = "http://MYIPADDRESS/servlet?key=number=&strAnswer&outgoing_uri=SOMETHINGAWESOME"
objExplorer.Navigate strURL
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 800
objExplorer.Height = 800
objExplorer.Visible = 1
0
I am following Pulover's Tutorial on youtube and cant seem to get the same outcome as he does. I am trying to learn to use COM to interact with Excel at the moment. Is it possibly dependant on the version of Excel I am using vs what he used in the totorial. Is there some way to trouble shoot the issue I am having?

Here is my code... Excel is already open and a cell is selected.
XL := ComObjActive("Excel.Application")
XL.ActiveCell.Value := "Test"

Open in new window


Here is a link to the tutorial... What I am trying to achieve is demonstrated at about 7:08
Pulover's MacroCreator Tutorial
0
I need an advice for filemaker file opening script.
I would like to set a launching script when opening a filemaker file and decide a layout, depends on the device type, like laptop vs smartphone.
0
Hi,

In PowerShell, how can I exclude a specific string from string?

Like:

$user= ”domain\user01”

I want to remove “domain\”

Thanks
0
I would like a script that I can modify to be able to the following:

Use Office365 smtp
Port 587
TLS
to accept username and password
have a pdf attachment to it called 1.pdf
Send to a distribution list from. EmailList.txt
0
I would like to change this script so that uses the smtp server:  smtp.office365.com
Port 587
Encryption TLS
Username:  username@yourdomain.com
Password: xxxx



###PROGRAM START###
      # Invokes the Send-MailMessage function to send notification email
      $splat = @{
            From =                  'info@info.com'
            To =                  Get-Content -Path ( Join-Path $PSScriptRoot 'DistributionList.txt')
            SmtpServer =      'smtp.server.com'
            Subject =            $subject
            body =                  $MessageBody
            BodyAsHtml =      $true
            Attachment =      ( Join-Path $PSScriptRoot 'abc.pdf' )
      }
      Send-MailMessage @splat
###PROGRAM END###
0
Hi,


I'm trying to export info from txt file and export in csv file. I try to do that with PowerShell but I don't know how.

Example:

ADFS info in txt file:
---------------------------------------------------------------------------------------------------------------------------------
@RuleTemplate = "MapClaims"
@RuleName = "MyDomain\Grp-Tools"
c:[Type == "http://schemas.xmlsoap.org/claims/Group", Value =~ "^(?i)MyDomain\\Grp-Tools$"]
 => issue(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = "S-1-5-21-2063951012-1603470910-623658099-21907", ValueType = c.ValueType);

@RuleTemplate = "MapClaims"
@RuleName = "MyDomain\Grp-App"
c:[Type == "http://schemas.xmlsoap.org/claims/Group", Value =~ "^(?i)MyDomain\\Grp-App$"]
 => issue(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = "S-1-5-21-2063951012-1603470910-623658099-21904", ValueType = c.ValueType);
 
---------------------------------------------------------------------------------------------------------------------------------
 
 Result in csv file should look like tis:
 
 ADNAme,SID
 MyDomain\Grp-Tools,S-1-5-21-2063951012-1603470910-623658099-21907
 MyDomain\Grp-App,S-1-5-21-2063951012-1603470910-623658099-21904
 
 
 Someone can help please?
 
 
 Thanks
1
Hi,

I have a list of servers names in a csv file and I would like to get their IP Address and see if they respond to a ping.

How can I do that with PowerShell?

Thanks
0
Hi,

My VSCode shows
Initializing JS/TS language features" stuck on the status bar

it never stops.
Please advise since VSCode sometimes is unresponsive.
J.
0
We need to Migrate Windows 2000 Server on vSphere 6.5

Existing Windows 2000 is a Physical Server , How can we migrate this to VM using VM converter supported version for 6.5?

What should be best approach to get it migrated to VM on my vSphere 6.5


Thanks!
0
from a batch file how can I run a command with an elevated command...

for examlpe I want to "net start ..... servicename"

How do I run this as if I was right clicking on cmd and then run as Administrator?
0
Hi expert

Need help, I am not strong in Powershell.

I was task to automate the manual windows server patch by using powershell script.

For your information we don't have SCCM environment, let me share the use case show in the following;

Not sure is it possible to achieve the following;

1: Powershell script will get file from SFTP and deploy patch to the Windows Server 2016.
1
How to connect to a another domain from code so i can execute AD command-lets. Can i include the credentials withing the code ?
I know i have to include the Import-Module ActiveDirectory

Thank for your help,
0

Scripting Languages

28K

Solutions

21K

Contributors

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.