[Last Call] Learn how to a build a cloud-first strategyRegister Now

x

Scripting Languages

26K

Solutions

20K

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

Hi expert

How to write a powershell script to automate the process for getting a file from the C drive from the server show in the followng path  "C:\Program Files (x86)\CCTE\OutstandingBalance " and email to users.

Thanks
Alan lam
0
[Webinar] Cloud and Mobile-First Strategy
LVL 11
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Hi,

Howto get (with regex) everything which is between the tags <table class='whatever' > ... </table> (including the tags theirselves) in an html page?

J.
0
Hello to all VB Guru's

I'm trying to make a vb script (.vbs) subroutine that will:

Continually check if a process (.exe) is running
Once it's done running (finished), then launch another program (.exe).
 
Everything I've tried to far, doesn't work.

Really appreacate all your assistance!

-Mac
0
I have Comodo for virus protection now, so I want to uninstall AVG Business.  Comodo has a script that uninstalls AVG and installs Comodo, but Comodo is already installed on the machines, so I am looking to just uninstall AVG.  Can someone please look at this script and let me know what can be changed.  I thought that I had changed it, but every time it ran there were errors, so this is the original script:
import socket
import _winreg
import os
import shutil
import time
import ssl
import time
import ctypes
import urllib2
import getpass
def Avgpres():
    ret=os.popen("wmic product get name").read()
    if 'AVG' in ret:
        AVGUninstall()
    else :
        print "AVG Uninstallation compelted"

def Download2(Download_URL,Download_Path):
    
    fileName = Download_URL.split('/')[-1]
    DownTo = os.path.join(Download_Path, fileName)
    context = ssl._create_unverified_context()
    f=urllib2.urlopen(Download_URL,context=context)
    data=f.read()
    print f.getcode()
    with open(DownTo, "wb") as code:
        code.write(data)
    return DownTo
  

def AVGUninstall():
    Download_Path=os.environ['PROGRAMDATA']
    os.chdir(Download_Path)
    Download_URL ="http://files-download.avg.com/util/tools/AVG_Remover.exe"
    path=Download2(Download_URL,Download_Path)
    out=os.popen(path+' -silent -norestart').read()
    time.sleep(90)
    os.remove(path)
print  "Computer Name: " +socket.gethostname()
print "IP-Address :"
print  

Open in new window

0
What is the best way to test for the existence of an object w/JavaScript ?

We are using Mirth msg engine to move message, Mirth uses Rhino JavaScript to evaluate scripts and return values.
but we don't know the best way to evaluate the existence of an object.

Thanks


var myObj;

if (myObj) { // code }

if (myObj == 'undefined') { // code }

if (myObj.length() > 0 )  { // code }

Open in new window

0
Hello,

I have an Excel file with some Powershell scripts that are automatically filed from other cells.
What I need is to create a button that will copy /past each command individually in one Powershell session.
The scrips are located on the cells (W3,X3,Y3,Z3, AA3 and AB3)

I will like firs to open powershell running a ps1 file and the on that session to copy paste the scrips located in the cells a following:

- W3
- wait time 10 seconds
- X3
- Y3
-Z3
-AA3
-AB3


Thank you and I appreciate the help.
0
hello folks, I'm an amateur w/ poweshell and I like to know if this possible, what I like to add as an object is the "pcname"
something like

Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion | select myobjects... "PC name or ENV:pc (HOSTNAME)"

is this even possible?


the truth is that this cmdlet doesnt have an option for remote computer...and I'm having to send a psexec to connect to PS then send the command instructions....I know it's bit messy and the results are more so,  but then again I'm Workin w/ what I have since my environment doesn't have remoting enable...and to be honest I think the ports are blocked. my security guy is a no, no, no...

thanks for helping
0
Hi Experts,
We have a application on Linux server (RHEL/CentOs), frequently we have to install & uninstall that application from a long process.  I need a script for that process. Please suggest.

Installation Process:-

[root@119 ~]# cd Linux_811
[root@119 Linux_811]# ./8.0.11_Setup.sh
------------------------------Welcome to ET Installer------------------------------
It is recommended that, ET Installation should be done using "root" login.
Also ET_8.0.11_SetupFiles.zip and the installer script should be kept in the same directory.
The L2llowing ET Installation will allow only ***Single Client connectivity to ET***.
Continue with Installation/Upgradation [(y)es/(n)o] ? y
Please Enter your Broker ID : 8877


        *********************** INSTALL ET FOR *************************
         1. Login 1 (L1)
         2. Login 2 (L2)
         3. Login 3 (L3)
         0. Exit Installation
        ******************************************************************
 Enter your choice      1
Select additional login? [(y)es/(n)o/(q)uit]      y

        *********************** INSTALL ET FOR *************************
         2. Login 2 (L2)
         3. Login 3 (L3)
         0. Exit Installation
        ******************************************************************
 Enter your choice      2
Select additional login? [(y)es/(n)o/(q)uit]      n
Default destination directory L2r ET installation: [/usr/bin]
Press Y to continue, N to select another path L2r…
0
hi,

i am stuck with a question from a customer!

my customer wants a webpage with a button that show a random number between 0 and 4000.

but the script need to generate that numer one by one. so first click the first number, then the second number, then the thirth and then the last number.

and the total number cannot be higher then 4000.

can anyone build this for me? i need a html of php page that can do this?
0
I have 1 folder called PDFFILES, and in that folder that are many suborders.
In each subfolder, either 1 or 2 or 3 pdfs might be found there.

I want to run a script, that will look in the main PDFILES subfolder.
Then it needs to look into each subfolder and if it finds more than 1 pdf in each subfolder, I would like them to be joined all in 1 pdf file, per subfolder.

Can this be done?
Many thanks for all your assistance.
0
Prep for the ITIL® Foundation Certification Exam
LVL 11
Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Hello all,
    I am looking for a way to have a linux user created on a sFTP gateway automatically with the credentials that were used when a user was created in a database. We have a web application in which we onboard a user and create their account. We would then have to go and manually create a linux user on the sFTP gateway, as it uses standard linux users as the credentials to login to FTP.

Is there a script (perhaps bash or python?) that can either use some sort of trigger to know when a DB user is made, then create a user on the FTP server. If it can use the same credentials that would be ideal, but if not, it can create a random password and then we can have it email it to the user perhaps. If there is nothing made already, if someone could point me in the right direction as to the best way to go about this, or what language would be ideal, please do.

Thanks!
0
I have created two jil files name AY.jil and PY.jil. I have three issues which are as follows:

1. how do you add a global variable value from a shell script program to a jil
    file?

2. PY.jil  needs to check every five minutes on the completion of the AY.jil
    jobs and AY.jil needs to check every five minutes on the completion of the
    PJ.jil jobs.

3.  How do you setup the watch_file in each jil to check every five minutes?
4.  How do you set up the success command for the file dependency?

I am getting this error :

I am only interested in reading in the global variable value 2 in PJ.jil:
  sendevent -E SET_GLOBAL -G "DIFF_VALUE=2"

Here is part of my shell script program:

while read DIFF_VALUE FLAG
do
	
	if [ "${DIFF_VALUE}" -ge "2" -a "${FLAG}" = "Y" ]
	then
		
		sendevent -E SET_GLOBAL -G "DIFF_VALUE=2"
		
	elif [ "${DIFF_VALUE}" -lt "1" -a "${FLAG}" = "N" ]
	then		
	        sendevent -E SET_GLOBAL -G "DIFF_VALUE="
	
	fi
done < ${DIFF_FILE}

Open in new window

Here are my jil progams (AY.jil and PY.jil):

Insert PJ_job: cmd_job
job_type: CMD
command: /path/to/script/script.sh  DIFF_VALUE=$${DIFF_VALUE=2}
watch_file: /path/to/script/AY.jil
watch_interval: time_in_mins
machine: machine_name
owner: user_name
condition: s(/path/to/AY.jil)

Insert AY_job: cmd_job
job_type: CMD
watch_file: /path/to/script/PJ.jil
watch_interval: time_in_mins
machine: machine_name
owner: user_name
condition: s(/path/to/PJ.jil)

Open in new window

0
I am having a file named Trade.txt having n number of lines.
I need the last line to get deleted ( The last line is the string "Report type" ) & I need to add new characters to the last line.
The new character is "Trans Date".

Please help me somebody as I am new to scripting
0
I have had a couple issues lately where end user's email worked fine but when someone sent them a calendar invite they could except it and it seemed ok, but a meeting change or cancelation would not go through and the sending user would get a bounce back that the mailbox was full. I questioned the Exchange people on here and after a little research it turned out the be the dumpster on the two users was full. I expanded the respective dumpsters and everything fell back into place. Now, I am wondering how many other users are approaching similar issues. Is there a script I could write that would report everyone's dumpster size along with how much space they have been allocated? Maybe something I could run on a regular basis to monitor for this usual issue. All help is welcome. I was thinking powershell, but I am open to all ideas.
0
Hi all!

I have a very long output from a cat config.txt that is divided in sections.

Every section begins with:

FILESYSTEMNAME /var

or

FILESYSTEMNAME /media

or other file systems name

Then I have several rows including information about that filesystem, this is an example of a cat config.txt:

FILESYSTEMNAME /media
STUFF mystuff
SIZE 10gb
CREATIONDATE 12/4/2017
STUFF mystuff
STUFF mystuff
PARTITIONNUMBER 1

FILESYSTEMNAME /tmp
OTHERSTUFF myotherstuff
OTHERSTUFF myotherstuff
OTHERSTUFF myotherstuff
SIZE 30gb
STUFF mystuff
CREATIONDATE 10/5/2014
PARTITIONNUMBER 2


FILESYSTEMNAME /
SIZE 10gb
STUFF mystuff
CREATIONDATE 12/4/2017
OTHERSTUFF myotherstuff
PARTITIONNUMBER 1

As you can see the sections can contain a variable number of parameters, I've used STUFF and MYSTUFF to simulate that in the provided output.

I'd need to get, for example, the number of the month of CREATIONDATE for /tmp filesystem (using BASH), in this case the result would be 5.

What can I do to be get a reliable result?

Thanks for your help.
0
A friend of mine is trying to do the following (as best I can understand):

If there are 2 computers and one is 1b2f1 and the second is 1b2f2 and the password is password, then the first computer would be set to password1b2f1 and the second would be set to password1b2f2.  Anyone done this (with a script as there are a ton of computers to do)?
0
I am looking for a script I can simply double click on, and it will join 2 pdfs that end with A.pdf and Q.pdf.
For instance in folder c:\files\... I have many files.
for example..

12345A.pdf
12345Q.pdf
75123R.pdf
45212R.pdf
78787.Q.pdf

When is looks in this folder it will take file 12345A.pdf and file 12345Q.pdf and join them to form 12345.pdf
And it will delete 12345A.pdf and 12345Q.pdf

The script needs to look through the list and see if there are 2 same prefixes, however one ending with A.pdf and the other ending with Q.pdf and then join them.

I believe pdftk server will allow for joining however I am not sure if it can get this granular.

Thanks for your help.
0
Hello Everyone,

I have a VBScript that I use as a GPO logon script for users, I need to prevent the script from running on server in the event of one of the users logs in to a server. So I just need help writing an IF statement that determines the OS version and run it on Windows 7 or Windows 10 only.

Thanks in advance.
0
Dear Experts,

I have windows 10 enterprise edition and my users are on win7.

I need to run PowerShell command on few specific workstations to enable windows feature remotely so that I do not need to do floor walking for each machine.

Could someone please validate this script;

Invoke-Command -ComputerName 10.0.0.22, 10.0.0.23, 10.0.0.24 -ScriptBlock { Enable-WindowsOptionalFeature -online  -FeatureName "ServicesForNFS-ClientOnly" } -credential my username
thank you
0
Free Tool: ZipGrep
LVL 11
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Two days remain to enroll in November’s PHP, mySQL, and CakePHP MVC framework Course of the Month!
0
Hello,

Can you help me in reading this .bat and robocopy execution ? Thanks for your help

md \\server\share\LogFile\%date:~-4,4%\%date:~-10,2%
md \\server.lcl\files\Reports\Archive\%date:~-4,4%\%date:~-10,2%\%date:~-7,2%

robocopy /MOV /v /lev:0 /log+:\\server\share\LogFile\%date:~-4,4%\%date:~-10,2%\log-%date:~4,2%%date:~7,2%%date:~10,4%.txt "\\server\share" "\\server.lcl\files\Reports\Archive\%date:~-4,4%\%date:~-10,2%\%date:~-7,2%" 

Open in new window

0
Hi Expert.

I am trying to run this github  cloudFormation template but I am getting the following error

https://gist.github.com/ashvinishinde-tudip/79a445af4a1ca2adbb5241f5df7cce44

error

Template validation error: Invalid template property or properties [1, 2, 3, DoNotify, 4, PassPercent, 5, 6]


is there anyone can help me how to resolve this issue. I have looked at the above script it is missing "Resources":  & "Properties":
0
I have the correct columns names appearing, but have a hard time getting them to actually center on each puzzle piece.

Column names out of center
The CSS I created is here.

puzzle-canvas.component.css
.column-number {
    width: 12%;
    margin-top: 12px;
    float: left;
    box-sizing: border-box;
    position: relative;
    text-align: center;
    z-index: 10;
}

Open in new window


The single line I added to the template is:

puzzle-canvas.component.html
    <div class="column-number" *ngFor="let i of columnNames" >{{ i }}</div>

Open in new window

0
I am successfully generating unique column and row names for each puzzle piece, but need to get those values onto the page.

The values, on the last lines, are logging correctly to the console.

    ngOnInit() {
    this.id = this.value.id;
    this.row = this.value.row;
    this.column = this.value.column;

    this.imageFilename = "PuzzlePiece_Maps_" + (this.value.id + 1).toString() + ".gif";
    this.isDogEared = this.dogEarIndexes.indexOf(this.id) > -1;
    console.log('Id:'+this.id + " - " + "row:" + this.row + " column:" + this.column + " " + this.imageFilename + " isDogEared="+ this.isDogEared.toString());    
  }
}

Open in new window


but, I am unsure how to insert the row and column values on the page.

 added a dog-ear class thusly:

    <div [ngClass]="{ 'dog-ear' : isDogEared }"></div>

Open in new window


I need the row and column on the HTML since I plan to flip the puzzle piece over and display the column and row name. Is the logic for this as simple as creating a click event which toggles a boolean? Then, on the HTML template, simply using that boolean to display one div or another?

I also need the column and row names on the canvas, so like a spreadsheet, I can show the entire puzzle thusly...

       A     B     C     D    E     F    G     H
1
2
3
4
5
 
So, i need to find where to insert those values here also:
<div class="puzzle">
    <puzzle-piece *ngFor="let piece of pieces, let i=index" [value]="piece"></puzzle-piece>
</div>

Open in new window


I set those column and row names in the puzzle-canvas component:

  constructor() { 
    this.rowNames = ['1', '2', '3', '4', '5' ];
    this.columnNames = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' ];
  }

Open in new window


Thanks.
0
I need to animate, then flip, the image in a certain puzzle piece cell.

Screen-Shot-2017-11-23-at-6.02.02-PM.png
I want to enable this functionality with a left click on any puzzle piece, that has a dog ear. And I suppose I want to "tear" the piece from upper right corner to lower left corner.

Once inverted, it can display a white background, for now.

I currently designate which gets a dog ear with these code snippets:
this.dogEarIndexes = [ 0, 2, 4, 11, 12, 19, 21, 23, 29, 35 ]; 

 this.isDogEared = this.dogEarIndexes.indexOf(this.id) > -1;

 <div [ngClass]="{ 'dog-ear' : isDogEared }"></div>

.dog-ear {
	position: absolute;
	top: 0;
	right: 0;
	height: 20px;
	width: 20px;
	background: linear-gradient(45deg, #333 0%, #333, #fff 50%, #fff 100%);
}

Open in new window


I have a puzzlecanvas which contains a matrix of puzzlepiece components.

I assume the event must originate with the puzzlecanvas, perhaps in the component.ts file:

import { Component, Input, OnInit } from '@angular/core';
import { NgFor } from '@angular/common';
import { PuzzlePieceComponent } from '../puzzlepiece/puzzle-piece.component';

@Component({
  selector: 'puzzle-canvas',
  templateUrl: './puzzle-canvas.component.html',
  styleUrls: ['./puzzle-canvas.component.css']
})

export class PuzzleCanvasComponent implements OnInit {
  title = 'Puzzle Peace';
  @Input() piece:PuzzlePieceComponent;
  pieces = [];
  columns:number = 8;
  rows:number = 5;

  constructor() { }

  ngOnInit() { 
    let index = 0;
    for(let row = 0; row < this.rows; row++) {
      for(let column = 0; column < this.columns; column++) {
        this.pieces[index] = new PuzzlePieceComponent();
        this.pieces[index].id=index;
        index++;
      }
    }
  }
}

Open in new window


and the functionality for the animation needs to go into the
puzzle-piece.component.ts file?


Open in new window

0

Scripting Languages

26K

Solutions

20K

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.