[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Scripting Languages

27K

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

This is intend to use a vbscript to check for the any USB attached devices. After went through few rounds of testing, found that "USB thumb drive" is appear as "removable disk". While "USB external hard disk" is appear as "local fixed disk". Coincidently, the local hard disk deployed on the PC is appear as "local fixed disk", with drive letter c:. Please see the script contents as follows. I divided the checking on 2 parts, first being the "removable disk" checking, follows by "local hard disk" for usb external hard disk.

Wscript.Echo "Security Checklist: Removable Disks - USB HardDisk & USB Thumb Drive"
Wscript.Echo "--------------------------------------------------------------------"

'for removable disk only - usb thumb drive

'bolDeviceFound = False
'strComputer = InputBox("Enter the name of the computer to Search for USB devices:")
 
 
'query the WMI service for the computer name
 
'Set objWMIService = GetObject("winmgmts:" _
'   & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
   
 'display the connected computer  
' WScript.Echo "You have connected to computer " & strComputer
'strComputer = "."

Set colItems = objWMIService.ExecQuery ("SELECT * from Win32_LogicalDisk WHERE Description = 'Removable Disk'")
 
For Each objItem in colItems
'      WScript.Echo "The computer " &strComputer &" has a removable USB drive connected with drive letter: " & objItem.Name
        WScript.Echo "The computer has a removable USB thumb …
0
Become a Certified Penetration Testing Engineer
LVL 12
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Greeting Experts -  

I need help creating a PowerShell script to pull text document from a list of computers (1000+) using Domain Admin Credentials. The text document in question will have the same name (i.e., pc1.txt, pc2.txt, pc3.txt) as pc located in the C:\drive (i.e., C:\pc1.txt). The script needs remotely pull the text document from each pc "with the same name as the pc" and copy it to a network shared drive....  Can somebody help me with this task.....
0
HI,
I am getting the following error while using ansible playbook :
FATAL: command execution failed
hudson.AbortException: Ansible playbook execution failed
	at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:236)
	at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:207)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:945)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:896)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
	at hudson.model.Run.execute(Run.java:1724)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:421)
ERROR: Ansible playbook execution failed
Finished: FAILURE

Open in new window


Although this is somewhat random i agree. But any ideas or tips for debugging it or why it could be happening ?

Thanks
0
This is another vbs script to find out the local computer for any shared folder. Please see the script contents,

   strComputer = "."
 
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService= objSWbemLocator.ConnectServer(".", "root\cimv2")
 
Set colShares = objWMIService.ExecQuery("Select * from Win32_Share Where Type=0")
 
For each objShare in colShares
 
    Wscript.Echo "Name: " & objShare.Name  & vbCrLf _
                       & "Path: " & objShare.Path & vbCrLf  _
                       & "Type: " & objShare.Type  & vbCrLf _
                       & "Allow Maximum: " & objShare.AllowMaximum & vbCrLf _
                       & "Maximum Allowed: " & objShare.MaximumAllowed & vbCrLf _
                       & "Caption: " & objShare.Caption  
Wscript.Echo "---------------------------------"
Next

Using this script, I manage to get the list of shared folders. How about if I want to know the share/ntfs permissions of the shared folder, what should be added into the script?

Thanks in advance
0
This is intend to use a vbs script to show the status/startup of selective list of services for Windows 7/10 machine. This script is going to be executed locally on the selected machine, and output the results to a file. Please see the vbs contents,

  Const strSVCName = "DNS Client"
  Dim objWMIService, colServices, objService, strComputer
  strComputer = "."
  Set objWMIService = GetObject("winmgmts:" _
  & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

  Set colServices = objWMIService.ExecQuery("Select * from Win32_Service WHERE DisplayName = '" & strSVCName & "'")

  For Each objService in colServices
   Wscript.Echo strSVCName _
   & vbcrlf & "Status: " & objService.State _
   & vbCrLf & "Startup Type: " & objService.StartMode
 Next

So far, I can only get a single service to work. However, I wanted to get an "array" of services, for example, Windows defender firewall, symantec endpoint protection, and so on. How to do it?

thanks in advance.
0
Hi Experts,

I have this question after resolving the following

https://www.experts-exchange.com/questions/29127578/script-to-convert-all-characters-in-excel-sheet-to-A.html?headerLink=workspace_answered_questions

How to modify the script in order to accomplish

1- Select which columns to get obfuscated.
2- letters should be changed with a logic, A should become B, B should become C and so on...Z should become A.
3- Same to numbers, 1 should become 2, 2 should become 3 and so on, then 9 should become 0.

Thanks
0
What is the command line, within a batch, if possible, to start that batch in Administrator mode?
Or would another batch be needed to trigger this batch in Administrator?
0
Hello,

How to add multiple user of different domain in single Forest in One Universal Group

I have with me SAM account name

Group is in Root domain and users are from all child domain

like root domain and child domain is below

abc.com
  xyz.abc.com
  asd.abc.com

Group name is : contoso-adGroup


Please suggest a script

Thanks
Addy
0
Hi Experts, I'm trying to automate an uninstall process for a certain product installed throughout the domain.
Basically, the script works fine right up to the point where I actually call the MSI.

I get the uninstall flag correct and I get the product code from the Registry Value (from the uninstall string itself)

but whenever I get to the uninstall command itself, I get the MSI usage window, as though I have a syntax error.

Here's the script I'm using:

$TARGETDIR = 'C:\logs\'
$LOGFILE = 'C:\logs\script.log'
$uninstallLog = 'C:\logs\uninst.log'

if(!(Test-Path -Path $TARGETDIR )){
    New-Item -ItemType directory -Path $TARGETDIR
}

function WriteLog { #Adds info to log file with time stamp
    Param ([String] $Message)
    $tStamp=Get-Date
    $Day=$($tStamp).Day
    $Month=$($tStamp).Month
    $Year=$($tStamp).Year
    $Hour=$($tStamp).Hour
    $Minute=$($tStamp).Minute
 
    echo "[$Day\$Month\$Year $Hour`:$Minute] $Message" >> $LOGFILE
}

function getUninstallString {
    Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -like '*Enterprise Vault Outlook Add-in*' } | Select-Object -Property DisplayName, UninstallString  
}



$evVersion = Get-WmiObject -Class Win32_Product -ComputerName . | Where-Object -FilterScript {$_.Name -like '*Symantec Enterprise Vault Outlook Add-in*'} | select -ExpandProperty 

Open in new window

1
I'm new to PowerShell and am trying to do a search on a mailbox for selected search terms.
My end goal is to read a CSV file with a list of search terms and the result should return True or False for each search term that exists in the mailbox.
For now what would be the command I need to return the status of the search?
The following is a simplified version of my script.

# ***********************************
# Logon
# ***********************************
$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session -DisableNameChecking

# ***********************************
# Do Processing
# ***********************************

# Is this the best way to search?
Search-Mailbox -Identity "Dave" -TargetMailbox "C1SearchResults" -TargetFolder "C1" -LogOnly -LogLevel Full -SearchQuery '12345 OR 56789 OR 13579' 

# What to go here to return TRUE/FALSE if string exists.


# ***********************************
# Logoff
# ***********************************
Remove-PSSession $Session

Open in new window

1
Build an E-Commerce Site with Angular 5
LVL 12
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Hi ...
Daily, I copy large files over 20GB using rsync to USB keys from Debian machines.
What is the fastest tool/way i can use to improve the transfer time.

Thank You for your help.
0
Hi guys

I've got an Excel sheet with around 12 columns and around 34 rows of content. I want to be able to do a mail merge, so that the content of 4 out of 12 of these columns and all of the rows can be sent to our ticketing system to create a separate ticket for each row.  

Is there a way to do this?

Thanks for helping
Yash
0
Hi..
I have a file similar to the below example:

/../../PVD
/../../PVD1
/../../PVD2
/../..PVD3

In a bash script How can I 'for' loop from the last item to process an action.
0
hi, I need a script or tool for getting change history audit for last month in "file". Something  like -  name - "file.xls", change date - "01.12.18", changed by - "user01", change type - "modified" .
File is in our file server. thanks
0
Please help to assist on
  • Best Practice to to clean C Drive on 2008 R2 and 2012 R2
  • What if Winsx is consuming much more space in C Drive ?
  • What is standard size required to have minimum size of Os drive @Win 2008 /R2 ,Win 2012 /R2
  • Any Cleanup Script /tool we can use enable for multiple Boxes in domain

Thanks in Advance!
0
Hi ..
I am trying to query the nameserver ips from /etc/resolv.conf file and then create a file as below:
dns1 10.10.10.1
dns2 10.10.10.2
dns3 10.10.10.3
dns3 10.10.10.3

Open in new window


using the below code, I am able to query the ips but i need help to create a file as shown above.
ns=$(cat /etc/resolv.conf  | grep -v '^#' | grep nameserver | awk '{print $2}') 

Open in new window


Could someone please help.
Thanks
0
Hi..
in a python script how can i get all the ip address of  the DNS servers on the network.

Thank you for your help.
0
I have a Tkinter application (python 2.7) that copies , configures , remove files. During this operation, I would like to pop up a please wait message box without any buttons while the process is running to inform the users What is the best way to do this.
Thank you for your Quick Prompts.
0
I would like to change the script below, to produce a different output.  

Here is the file that contains the data to use.
C:\Users\user\Desktop\Folder\file.txt

ISA*11*          *22*          *33*1234567891234  *BB*ABCDEFGDH       *181127*3445*¬*00100*000000500*1*Q*:!
GS*PO*0012345678912*JDJDLSLA*20181127*3445*600*A*001234!
ST*850*78945611!
BEG*11*AB*12345**20181127!
N1*CD*COMP*LA*0012345678901!
N3*1 Street Drive!
N4*Pineland*OL*12345*US!
N1*AJ*SOMECOMPANY!
N1*TJ*Company Corp*2*456363748!
N3*1 Street Road!
N4*City, Somewhere**12345*u!
N1*AC*Company*2*987654321!
N3*1234 Street Blvd!
N4*Someplace*NY*12345*US!
N1*YG*Company Name*AL*0012345678912!
N3*5 Place Drive!
N4*Ackanhaw*MI*654321*US!
PO1**151*CA***IN*5465*CR*789456*GG*55555*EQ*Case(s)!
PID*F****Description One!
CTT*3****5*PQ!
SE*30*1234567!
GE*5*500!
IEA*1*000004567!


Here is the current script:
$InputFile = "C:\Users\user\Desktop\Folder\file.txt"
$OutputFile = "C:\Users\user\Desktop\Folder\fileR.txt"

Function ParseText ($OutputFile,$InputFile){
Begin{
        $line,$poline,$shipto,$totline,$total,$i,$n3 = $null,$null,$null,$null,$null,0,0
            Set-Content $OutputFile $null
            $Data = Get-Content -Path $InputFile | ?{$_ -match "(BEG\*)|(PO1\*)|(PID\*)|(N\d\*)|(IEA\*)"}
       }
 Process{
       $Data | % {
       #Check the end of data set
             If ($_ -match "IEA\*"){
                   If($poline -ne $null -and $total -ne $null){
                         

Open in new window

0
Exploring SQL Server 2016: Fundamentals
LVL 12
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

When we get threat intels info for hashes to be added to Trendmicro
Officescan, the MD5 or SHA1 hash value has to be entered into an
IOC Editor (we use Mandiant's ie
 https://www.fireeye.com/content/dam/fireeye-www/services/freeware/ug-ioc-editor.pdf)
 to generate 2 values indicated by 1st value & 2nd value enclosed in "...'  below.

However, sometimes, the intel that comes in can be more than a hundred, so this makes
it very tedious to manually generate the values & populate into the IOC file for Officescan
to read in.  Is there an automated way / script to generate the 2 values for each hash &
auto-populate (using script etc) or an easier way for Officescan to read in just the hash
values?    Have logged a case with Trendmicro & was advised to do it manually which
does not help at all.

attached the full IOC file.


   Sample IOC file's content:
   ====================
<?xml version="1.0" encoding="us-ascii"?>
<ioc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="2146113a-1513-4be6-b07e-f43969847a6a" last-modified="2018-12-02T02:19:17" xmlns="http://schemas.mandiant.com/2010/ioc">
  <short_description>Default</short_description>
  <authored_date>2017-09-26T02:58:26</authored_date>
  <links />
  <definition>
    <Indicator operator="OR" id="a1c825b0-ae7f-4461-85dd-25a20720acac">          <== 1st value enclosed in "...";  once only for entire IOC file
      <IndicatorItem …
0
Hi ..
I booted from an bootable media and trying to chroot the root file system on the local drive to run a bash script (bscript.sh) in /usr/local/bin/ with 3 parameters which are files inside the /usr/local/bin/
i made a bash script as below:
mkdir /mnt/s1
mount /dev/sda1 /mnt/s1
chroot /mnt/s1 ./etc/local/bin/bscript.sh $(cat paramfile1) $(cat paramfile2) $(cat paramfile3)
But I get the error:
cat cannot find file paramfile1
cat cannot find file paramfile2
cat cannot find file paramfile3

/bin/bash: line 1 file not found

Open in new window


The bscript.sh runs without the parameters, since 'cat' cannot find the files that in the same directory as the bscript.sh (of course full path works with cat like:  cat /mnt/s1/....)
Could someone help to correct the above procedures.

Thank You for your Quick Prompts.
1
Hi ..
trying to resize NTFS partition in Linux using ntfsresize.  Getting the following error:
 
"volume is scheduled for check"

I tried option -f also but it did not resize the partition.
Any idea ....
Thank you for Your Quick Prompts.

Cheers
0
I would like to use a powershell/vbs script to run the following commands currently found in a .bat file:


@echo off
setlocal 

set password=xxxxxxxx
set /p password=<%~nx0:password
if not "%password%"=="" goto OK
set /p password=Enter password: 
echo %password%>%~nx0:password
:OK

set localdir=\\srv\folder\NewInbound\folder
set remotedir=/out_folder
set ftpserver=ftp.server.com
set username=xxxxxxxx

::del "%localdir%\*.*" /q

call :GetFtpFiles
call :ClearFTPFiles

exit /b

:GetFTPFiles
    (echo open %ftpserver%
    echo user %username% %password%
    echo bin
    echo cd %remotedir%
    echo lcd "%localdir%"
    echo mget *.*
    echo quit
    ) | ftp -n -i
    exit /b

:ClearfTPFiles
    (echo open %ftpserver%
    echo user %username% %password%
    echo cd %remotedir%
    (for /f "tokens=*" %%a in ('dir /b /a-d "%localdir%\*.*"') do @echo dele "%%~a")
    echo quit
    ) | ftp -n -i -d

Open in new window

0
Hi ...
I was wondering if anyone knows how to change default icons for a new user in Slitaz.
By default, trash icon and Document icon get added to desktop when a new user logs in for the first time.
I am trying to change it only to Terminal.
Thank you for your Quick Prompts.
0
Hi Experts,
Looking for a script that will perform the following
open a given spreadsheet, loop thru all columns/rows and replace all data as follows. (except for first row)
for every character found, replace it with letter A
for every digit found, replace it with 1
should leave any special character like slashes or space intact.
Thanks
0

Scripting Languages

27K

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.