[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
OWASP: Threats Fundamentals
LVL 12
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

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
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
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
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 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
Why Diversity in Tech Matters
LVL 12
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

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
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
Hi ...
Using the below command how to get the disk size always in GB.
disktotal=$(lsblk --nodeps --noheadings --output  SIZE /dev/sda)

Open in new window


Thank YOU.
0
Hi ..
After running a script the below IE11 pops out the below message:
The web page you are viewing is trying to close the window. Do you want to close this window? Yes|No
I tried different settings in the security tab like:
"Display Mixed Content"
"unchecked "Enable protected mode"
But none help so far. Does anyone know what option i need to change to prevent the popup.
Your Quick Prompts Highly Appreciated.

Thanks.
0
is there a way via powershell to supply a file share path e.g. \\server\share\directory and it report all sub directories (but only folders), and sub directories within those, out to a csv file? a bit similar to the old windows DIR command, but to not show all files within folders, only folder details

e.g. if I supply \\server\share - I get a report of all folders (as deep into the structure they go, but no more detail, e.g. files etc.

\\server\share\directory1
\\server\share\directory1\subdir1
\\server\share\directory1\subdir2
\\server\share\directory2
\\server\share\directory2\subdir1
\\server\share\directory2\subdir2
1
Merge very big text file
I need to merge 12 text files, every file up to 500 MB
I need it one text file
0
I have a script which scans given computers in domain  for identifying and disables mobile hotspot function in windows 10. Script works properly , but i want to scan all my domain comupters, not only specified.. can anyone help me for adjusting this script?

$username = "domain\administrator"
$password = "Your password"
$credential = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $password
$computers = @("nr1", "nr2", "nr3")
foreach($computer in $computers){
    $hotspot = Invoke-Command -ComputerName $computer -credential $credential -scriptblock {
    $hotspot = Get-Service "icssvc"
    if($hotspot.Status -eq "Running"){
        Write-Host "Hotspot is turned on on $computer" -ForegroundColor Red
        try{
            Stop-Service "icssvc"
            Write-Host "Successfully stopped service on $computer" -ForegroundColor Green
        }catch{
            Write-Host "Unable to stop service on $computer" -ForegroundColor Red
        }
    }else{
        Write-Host "No Hotspot running on $computer" -ForegroundColor Green
    }
}

Open in new window

0
Exploring SharePoint 2016
LVL 12
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

Hi there..

I would like to change the following X01 and ABC lines in a text
file from this format:

X01*00010*48*CA***TS*54589652358745*XA*589856562354*UR*000000054585789656~
ABC**PXP*20.1~

to this format:

X01**48*CA*20.1**TS*54589652358745~
ABC**PXP*20.1~

Every time it sees an X01 line I would like to modify it and every time it sees
an ABC line I would like to modify it to the format above.

There could be multiple X01 and ABC lines in any given text file so it's the format of the line changes that would be important and the movement of the data etc..

Is this possible in Powershell or Batch?

Thanks so much in advance.
0
Hi,
Trying to convert a python script into executable one file using pyinstaller in Linux. In my python script using subprocess I call few bash files, what is the best way to add them to the
executable as well. I use the comamnd: "pyinstaller --one-file pythonscript" to build the executable.

Thank you for your quick prompts.
0
I need to create some regex criteria to assist with a custom content filter in some eDiscovery software, to filter a 100 GB directory of data for any documents which contain a certain pattern of text to meet the criteria 9 characters long, first two characters any alpha (a-z), characters 3-8 any numeric characters, the final character any alpha (a-z). The alpha characters are likely to be uppercase but not always. Any sort of starting point will help as very new to regex
1
I would like to modify a CSV file found at ..

C:\users\user\Desktop\file.csv
A sample of the data is found below.
However there could be thousands of lines.


"Data1","Qty1","Qty2"
"ABC1234","0","0"
"ZDG123","525012","0"
"JKL432","0","0"
"TYI00121-1","0","0".
"No of Items","4",""


I want to modify it using a Script so that it searches through the file and when it sees ZDG123, or any other numbers that I will specify in position 1, that it will take the Quantity showing and divide it by 1000, and then re-write the file with the correct changed data.   For example for line shown above as:  "ZDG123","525012","0",  it will then become:   "ZDG123","525.01","0"

Would this be possible, using a scipt?
1
PowerShell Gurus,

I have a slight issue.  We are attempting to use PowerShell to automate the application of secure RDP SSL certificates to our RDSH hosts.

PS C:\WINDOWS\system32> $PSVersionTable

Name                           Value                                                                                                                                                          
----                           -----                                                                                                                                                          
PSVersion                      5.1.17134.407                                                                                                                                                  
PSEdition                      Desktop                                                                                                                                                        
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                        
BuildVersion                   10.0.17134.407                                                                                                                                                 
CLRVersion                     4.0.30319.42000                                                                                                   

Open in new window

0
Task schedule list powershell:

Dear expert, please help me with  powershell script to show all scheduled tasks.

Now the problem Im face right now is, in task schedule list, the location is: \01\02 \03 in location \01, there will be alot alot of task items with name of task1, task2, etc. the \02 got also alot of task items with name of task1, task2, with same name, I would like to show them in a list like: all \01\* list all task under it, and \02\* list all task under that, the problem I'm facing right now is list all the task under \01 didnt work with the attribute $_.folder -like '01' this return with null.

My code below got more critera in it, still return with 0 result.

Anyone know how do I do it in right way?

Thx
$schtasks = schtasks /query /fo csv -v | ConvertFrom-Csv | ? {$_.HostName -match "^$($Env:Computername)$" -eq "Enabled" -and ( $_.Folder -like '\01*')} 
$schtasks = $schtasks | Sort-Object "taskname" -unique
$schtasks = $schtasks | Sort-Object "Next Run Time"
$tasks72h = @()
$schtasks | % {
	if($_."Next Run Time" -ne "N/A") {
		[datetime]$NRT=($_."Next Run Time")
		if ( ($NRT -gt (get-date)) -and ($NRT -le (get-date).addhours(+72)) ) {
			$tasks72h += $_ | Select-Object taskname, "Next Run Time" 
		}
	}
}

$tasks72hCSV = $tasks72h | convertto-csv -notypeinformation | Select-Object -skip 1 | % {$_ -replace '"',''}

Open in new window

1

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.