Go Premium for a chance to win a PS4. Enter to Win

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

I've got a cron job that runs 4 times a day which uses a simple shell script to perform a mysql_dump then tar the file (DB_BACKUP-2017-11-18.55.25.tgz) and place it in a directory.

#!/bin/bash

backup_file="/share/CACHEDEV1_DATA/Web/SQL/vcal.sql"
backup_dir="/share/CACHEDEV1_DATA/Web/SQL/SQL_Backup"
tar_name=`date +%Y-%m-%d.%M.%S`

# Dump MySQL Database
/usr/local/mysql/bin/mysqldump --user="user" --opt vcal > /share/CACHEDEV1_DATA/Web/SQL/vcal.sql

# Backup MySQL Dump File
/bin/tar -czPf $backup_dir/"DB_BACKUP-"$tar_name.tgz $backup_file

exit 0

Open in new window


I'm trying to figure out a way to have the script delete backups which are older than 4 days.
Ideally, I'd like to be left with 16 files (4 are created per day) at any given time

Any suggestions?

Thank you for looking :)

Ken
0
Free Tool: Port Scanner
LVL 11
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Setup:
Below are the tables.  I need to find the last PO and Invoice for item 3m05620 which should be invoice 95.

p21_view_po_hdr    
po_no     supplier_id
1448099            123
1448099            123
1448099            123

p21_view_po_line
item_id                      po_no
3m05620            1448099
3m05620            1448099
3m05620            1448099
3m05620            1448099

p21_view_apinv_hdr
invoice_no      invoice_date      po_no
90            7/1/17            1448099
91            10/1/17            1448099
92            9/1/17            1448099
94            8/1/17            1448099
95            11/1/17            1448099
96            6/1/17            1448099

Results needed:
item               po_no            invoice_no       invoice date
3m05620       1448099            95                     11/1/17


Below is the script I have.  This script shows the last invoice_no is 96 and I want it to show the last invoice no based on invoice date so 95 since it has the most recent invoice date.

SELECT        p21_view_po_line.item_id, MAX(p21_view_po_hdr.po_no) AS po_no, p21_view_po_hdr.supplier_id, MAX(p21_view_apinv_hdr.invoice_no) AS invoice_no,
                         MAX(p21_view_apinv_hdr.invoice_date) AS invoice_date
FROM            p21_view_po_hdr INNER JOIN
                         p21_view_apinv_hdr ON p21_view_po_hdr.po_no = p21_view_apinv_hdr.po_no INNER JOIN
                         p21_view_po_line ON p21_view_po_hdr.po_no = p21_view_po_line.po_no
GROUP BY p21_view_po_line.item_id, p21_view_po_hdr.supplier_id
0
Hello all,

I've come up with an issue and was wondering if the pros could assist :)

Is it possible to lock, secure or encrypt the properties of an image file? Basically, when you right click the image and select properties you can see all the meta data details such as date, time, author, user, modified date etc.

I know through various methods and applications such as powershell, it is easy to clear these and amend but I want it so that noone can amend it! A tough ask, especially in this day in age of technology where everything can be manipulated but would really like a hand in this.

Happy to use/pay for a third-party application if needed.

By heavy Google searches people have mentioned to watermark the image but that's pretty low key on terms of protecting the image stamp.

Any help as always will be highly appreciated!

N00b
0
Hi Experts,
We have multipal windows system in network, in BOD process we need to copy some files in every systems manually, its a time taking process for me. Please suggest any bat (automatic) process to short out this trouble. Every systems having user name & password.
0
I am trying to create a script to search several computers and list what groups a specific user is a member of an export to a csv file.

Example:

ComputerA has a user called USERA that is a member of the local Administrators group and Remote Desktop Users group

ComputerB has a user called USERA that is a member of the local Administrators group and Backup Operators group

The cvs file would list the computer name, USERA, and groups that it is a member of

ComputerA,USERA,Administrators
ComputerA,USERA,Remote Desktop Users
ComputerB,USERA,Administrators
ComputerB,USERA,Backup Operators

Any help is greatly appreciated.
0
I am looking for a program, that will create either icons or shortcuts so that when you double click on it, it will send an email using office365, and with or without an attachment.
I want to be able to configure different email jobs/triggers so that I can simply click or double click on an icon etc. and it will send to emails I configure etc.. with or without specified attachments..
1
Hello everyone,
I just wanted to ask you if we are doing the most efficient way of resetting IIS and validating services on multiple computers.
 
Is this command could be simplified? We only have two servers where we are resetting IIS and 5 computers where we need to validate and set services.
 
Perhaps what we are doing here is NOT the most efficient process.
 
Let me know. Thank you so much!
 
1. At the elevated PowerShell prompt, run the commands below:
      a. Reset IIS
      $pors = (get-content "f:\software\servers.txt") | select-string "por0"
      Foreach ($por in $pors) {Invoke-command –ComputerName $por –ScriptBlock {iisreset}}

      b. Set all DEV services to Automatic - Running
      $servers = get-content -path "f:\software\servers.txt"
      Foreach ($server in $servers) {Invoke-command –ComputerName $server –ScriptBlock {get-service –displayname *DEV* | set-service –startuptype automatic –status running}}

      c. Validate all DEV services status
      $services = Foreach ($server in $servers) {Invoke-command –ComputerName $server –ScriptBlock {get-service –displayname *adms* | select pscomputername,displayname,status,starttype}}
      $services |format-table -autosize
 
0
Can someone explain the following vbs script code:

Set objFSO = CreateObject("Scripting.FileSystemObject")
 Set wshShell    = WScript.CreateObject("WScript.Shell")

'initialize logging
 strLogFile = wshShell.ExpandEnvironmentStrings("%TEMP%\CitrixReceiverShortcutClean.log.txt")
 Set objLogFile = objFSO.OpenTextFile(strLogFile, 8, True)
 objLogFile.WriteLine Now & ": Logging Initialized"

'get list of folders in C:\Users
 Set objFolder = objFSO.GetFolder("C:\Users")
 objLogFile.WriteLine Now & ": Got list of user folders under C:\Users"

For Each UserSubFolder in objFolder.SubFolders
	'search the users start menu for Citrix shortcuts
	objStartFolder = UserSubFolder.Path & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"
	objLogFile.WriteLine Now & ": Searching folder: " & objStartFolder
	If objFSO.FolderExists(objStartFolder) Then
		Set objSearchFolder = objFSO.GetFolder(objStartFolder)
		Set colFiles = objSearchFolder.Files
		For Each objFile in colFiles
		  If InStr(objFile.Name, ".lnk") Then
			IsCitrixShortcut objSearchFolder.Path & "\" & objFile.Name
		  End If
		Next

		ShowSubfolders objFSO.GetFolder(objStartFolder)

		' now search the users desktop for Citrix shortcuts
		objStartFolder = UserSubFolder.Path & "\Desktop"
		objLogFile.WriteLine Now & ": Searching folder: " & objStartFolder

		Set objSearchFolder = objFSO.GetFolder(objStartFolder)
		Set colFiles = objSearchFolder.Files
		For Each objFile in colFiles
			If InStr(objFile.Name, ".lnk") Then
	

Open in new window

0
Hello,

I would like to create a GPO that run a powershell script on the servers of my domain only one time because it's a script that create a scheduled task to clean IIS logs,

How can i do that ?

Best regards,
0
We have a process that automatically starts when a user logs on.  If we do a switch user, that process stays active under the original user and will not run for the new user. Does anyone know how to kill a specific process named "killme" when a user locks their workstation, without having to add a scheduled task for every possible individual who may log on to that particular machine?  Thanks
0
[Webinar] Cloud Security
LVL 11
[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

I have following string in textbox now I want to fetch some of the data and put into another textbox.

like
Within this string -
"<TH class=displaytable_attribute scope=col>GC No.</TH>"
i want only GC No. in label1 and its value from  this line  is 15470038084 in text box 1
"<TD style="COLOR: #000000" class=displaytable_value><A style="BACKGROUND-COLOR: yellow">15470038084</A></TD>"
and same for the rest of the value like
for GC Date in label3 and its value in text box 3
<TH class=displaytable_attribute scope=col>GC Date</TH>
and value  is
<TD class=displaytable_value>23/10/2017</TD>

 and so on for the rest of the fields........

hope you understand what i want

plz assist me how to do that

thanks in advance


Data I have in the following format

<TD class=style1><BR><BR>&nbsp;<A href="Index.aspx"><IMG style="HEIGHT: 41px" src="images1/1ee.jpg"></A></TD>
<TD><BR><BR>&nbsp;&nbsp;&nbsp; </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD style="WIDTH: 750px; HEIGHT: 100px">&nbsp;<BR><A class=Heading_TrackingDetails name=tracking>Tracking Details </A><BR><BR>
<TABLE cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD class=cellborder_none colSpan=6 border="0"><B>Booking Details</B></TD></TR>
<TR>
<TH class=displaytable_attribute scope=col>GC No.</TH>
<TH class=displaytable_attribute scope=col>GC Date</TH>
<TH class=displaytable_attribute scope=col>GC Time</TH>
<TH …
0
In our corporate, we have a Wifi that staff / guests have to register before they can
use it.  Subsequently after registration, each time staff/guest connects to it, they
have to click on "Lets Surf" in the landing/captive page.

I need to monitor this landing page for possible defacement/changes as it's been
known hackers ever hacked it such that the landing page is replaced with one that
will lead to an external Internet malicious site.

I thought of writing a script to dump out this landing page every hourly using
wget or curl but somehow wget or curl (Windows version) can never connect to
it to dump out this html page: I've tried specifying proxy & without proxy.

Purpose of dumping out this landing page is such that I could do a "comp" (ie
Unix equivalent of  "diff") against a baseline page to see if that page has changed.

What did I miss that  wget/curl could not dump out this page?  While I'm connected
to home Internet or my phone's 4G, the very same laptop could dump out, say
google.com

I ran wget from Windows command prompt while I ran curl from a "bash-like"
shell that runs on my Windows : both works on my home Internet but not
with the corporate's captive page.

When connecting each time to this 'secured' Wifi, it will lead to a URL that looks
like   http://www.wiresuss.com/login.php? . . .
0
In my test environment at home I need to create a Server 2016 PowerShell script that will launch the Office 365 PowerShell command line commands and automatically sign on with an Office 365 administrator username and password.

This isn't a security hazard since this will only be used on an Office 365 test domain on a computer at home that no one else has access to.

Please provide me with the correct syntax for doing this.
0
Hi,
So I have the below login script set for all users to map a network drive located on another network which the office has a VPN tunnel to:

@echo off

echo Please type your network user name

set /p username=


echo Please type your network password

set /p password=

Net use Z: \\Share\Shared$ /user:DOMAIN\%username% %password% /persistent:YES

The script works fine when run manually, but I just cant seem to see why it doesn't run on logon. When I pull gpresult it states it has applied successfully.

Thanks
Craig
0
I am looking for a way where I can click on a single file icon that will launch the Windows Power Shell and run the following commands:

$UserCredential = Get-Credential
Connect-MsolService -Credential $UserCredential
Connect-MsolService

So I will be prompted to and will be able to logon to Office 365 with my administrator account.

What is the best way to do this?
0
Hello folks,
i have created the following script to remove profiles from PCs, however what change would i make to skip the administrator profile?

$CLIENT = Get-Content "c:\Temp\computers.txt"
 
foreach($PC in $CLIENT){
    # Testing PC connectivity
    if(Test-Connection $PC -Count 1 -Quiet){
        # Gathering users from c:\users
        foreach($PCuser in (Get-ChildItem "\\$pc\c$\users" -Directory)){
            # delete  recursively
            RD "\\$PC\c$\Users\$($pcuser.name)\Desktop\*.*"
            RD "\\$PC\c$\Users\$($pcuser.name)\Downloads\*.*"
            RD "\\$PC\c$\Users\$($pcuser.name)\Documents\*.*"
            RD "\\$PC\c$\Users\$($pcuser.name)\Music\*.*"
            RD "\\$PC\c$\Users\$($pcuser.name)\Pictures\*.*"
            RD "\\$PC\c$\Users\$($pcuser.name)\Videos\*.*"
        }
    }else{
        Write-Warning "$PC is offline"
    }
} 

Open in new window


or if anybody has a a batch that'd be great too

Thanks for looking
0
Hi,

trying to figure out if this is possible or not, i am looking at a way to automate the enabling and is disabling of GTM & LTM pools within an F5 appliance,

We have two Sites primary and secondary if the primary site goes down, we have to go into Site 2 FS  LTM and GTM from the other enable and disable the Site 1 FTP pool. this can be a slow process, once I get alerts from IPMon stating Site1 is down I could run the program from my laptop to automatically bring Site 2 online.
0
Hi Experts,

We have been working on a script which scans through  xml files and pulls out information like database name, databaseServername etc from multiple xml files.

I am attaching sample xmls which are used by script to scan.

The script is as follows:
nohup timeout 15 cat context.xml
        sleep 10
        cat nohup.out|grep -i "driverClassName="|grep -i oracle >/dev/null 2>&1
 if [ $? -eq 0 ]
  then
        OUr=`cat nohup.out|grep url=|awk -F= '{print $2}'`
        DS=`echo $OUr|awk -F: '{print $4}'|sed s/@//g`
        DB=`echo $OUr|awk -F: '{print $NF}'|sed s/\".*//g`
        DB1=`echo $DB|sed s/\".*//g`

else
        DS=`cat nohup.out |grep url=|grep jdbc|head -1|awk -F/ '{print $3}'|awk -F";" '{print $1}'|awk -F":" '{print $1}'`
        DB=`cat nohup.out |grep url=|grep jdbc|head -1|awk -F";" '{print $2}'|awk -F= '{print $2}'|sed s/\".*//g`
        Ru=`cat nohup.out|grep "Environment name"|grep PegaRULES|awk '{print $3}'|awk -F= '{print $2}'|sed s/\"//g`
   if [ -z "$Ru" ]
    then
        Ru=`cat nohup.out|grep username=|awk -F= '{print $2}'|sed s/\"//g`
   fi
 fi

Open in new window


This works for 90 percent of cases which have only one Resource Name (example: context_works.xml and context_works2.xml)

But, in 10 percent of xmls when there are multiple resources (like context_doesnotwork.xml), it doesnt picks the right one, due to the oracle grep check, but I would like to be able to pick the resource which has the name=jdbc/PegaRULES.(It picks Oracle instead of picking the resource with name jdbc/PegaRULES). I would like to eliminate resources other than the ones with name=jdbc/PegaRULES before the grep for Oracle in the file.
Is there a way by which I can do that without losing much of the current logic?
context_works.xml
context_works2.xml
context_doesnotwork.xml
0
In my other question Setup Time Machine backup notifications serialband provided the following code (taken from the https://apple.stackexchange.com/questions/31444/send-background-email-alert-if-time-machine-backup-fails) website for sending email notifications whenever a Time Machine backup fails.

Please modify this code so that email notifications will also be sent whenever there are successful Time Machine backups and whenever Time Machine reports any errors or warnings. I need to be notified about everything having to do with Time Machine backups.

  tmutil latestbackup
    date "+%Y-%m-%d"
    mail -s "TimeMachine Failure Report from $HOSTNAME" "This mac needs attention"

#!/usr/bin/osascript
property i_The_Sender : "senderAddress1@ip.com"
property theAddress2 : "recipientAddress@ip.com"
set userNAME to ""
tell application "System Events"
    set userNAME to full name of current user
end tell
property theSubject : "TimeMachine Failure Report from "

set tm to do shell script "/usr/bin/syslog -F '$Time $Message' -k Sender com.apple.backupd -k Time ge -59m | tail -n 3"

if tm contains "failed" then
    set otherLog to do shell script "/usr/bin/syslog -F '$Time $Message' -k Sender com.apple.backupd-helper -k Time ge -59m | tail -n 20"
    tell application "Mail"
        set newMessage to make new outgoing message with properties 

Open in new window

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,
I need to add records to dataGridview using loop

see below my code is not working
  dataGridJobView.ColumnCount = 3;
            dataGridJobView.Columns[0].Name = "Job Number";
           dataGridJobView.Columns[1].Name = "Message";
            dataGridJobView.Columns[2].Name = "Vehicle Number";
 if (jobs != null)
                 {
                     foreach (var j in jobs)
                     {
                         row = new string[] { j.Id.ToString(), j.Message.ToString(),j.VehicleId.ToString() };
                         //dataGridJobView.Rows.Add(row);
                         //this.dataGridJobView.Rows.Add(j.Id.ToString(), j.Message.ToString(), j.VehicleId.ToString());

                         
                         count = count + 1;
                         //MessageBox.Show(String.Format("id:{0} {1} {2}",j.Id,j.Message,j.VehicleId));
                     }
                    
                 }
                 dataGridJobView.DataSource = row;

Open in new window

0
I'm looking for a simple web code (some simple script) which does not play well with Ghostery

Basically I'm looking for something to add to my website which will make a viewer of my website, who is using Ghostery, to not be able to fully use or see our page when Ghostery breaks our page.  The hope is to get them to disable Ghostery when viewing our website.
0
Hello,
Are there any Powershell experts out there?
I would like to create a Powershell script do to the three functions below. Please provide clear steps for doing this as I am a novice with Powershell

1. Start a program when Windows starts
2. The powershell script must start the programs by autologon using the programs stored usernames and passwords in the Powershell script (see attached files)
3. The programs must be started in minimised mode (in the taskbar)

My reason for doing this
* I don't want the programs to start in full mode or be launched manually for people to see the usernames or click SHOW to see the password. I also do not want to give out the usernames/passwords for these programs.

Both programs have the option of saving the passwords but after a few Windows reboots, the passwords are no longer remembered and require manual entry. I want to avoid this by not using the save passwords option but using Powershell instead.

If you're aware of any other scripting language that can do this, please let me know but I ask that you're clear with your instructions. I have ZERO knowledge of scripting.
steam.PNG
Origin.PNG
0
tut: https://www.coretechnologies.com/products/AlwaysUp/AutoIt/

Tool usage:

This is my error message , so how to run this?
ClickButton "Idle timer expired" "OK"
0
mRemoteNG portable url: https://github.com/mRemoteNG/mRemoteNG/releases/download/1.72/mRemoteNG-1.72.zip
I connect my RDP with mRemoteNG,the prolem is that sometimes my session is disconnected a small window appears and say,see the snapshot i atached
cap1.jpg
0
Hi,
 Every week, I need to run 7-8 reports from external software for same week period for almost 8 branches, is there any VBA codes which can help me to automate the process, where it saves all reports automatically from external software on network directory just by adjusting dates? Your help will be appreciated.
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.