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'm using ASE to create SCR and KiX script files. When I create a VBS or Bat file it allows me to use the Active Debugger that highlights each line of code as I step thru the script and can also watch the variables change. But when I create SCR or KiX scripts it only gives me a DOS window style debugger (see attached). Is there a way to make it use the Active Debugger when debugging SCR and KiX script files?
ASE-DOS-Debugger.png
0
Get 15 Days FREE Full-Featured Trial
LVL 1
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Hello,

I wrote a script to create a folder path and it works OK, however, it creates folders read only and I am trying to avoid that. I do not want it read only because then another process cannot create some files within the DATA folder. This is what I wrote and it is still creating the folders read only. Can you please let me know what am I missing?

mkdir -p "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA"
attrib -R "C:\Program Files\Microsoft SQL Server\*.*" /S /D
0
Hello,

I need to create a script that can automatically create username1 and username2 but also add sysadmin role to the NT AUTHORITY\SYSTEM username. It keeps saying that I do not have access to do it. If I manually add sysadmin role to NT AUTHORITY\SYSTEM and run the script it works fine and creates both usernames and their policies and roles but I have not been able to automate the sysadmin assignment. Below is my script:

ALTER SERVER ROLE [sysadmin] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO
CREATE LOGIN username1 WITH PASSWORD = 'password', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF;
GO
EXEC sp_addsrvrolemember 'username1', @rolename = N'sysadmin';
GO
EXEC sp_addsrvrolemember 'username1', @rolename = N'dbcreator';
GO
CREATE LOGIN username2 WITH PASSWORD = 'password', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF;
GO
EXEC sp_addsrvrolemember 'username2', @rolename = N'sysadmin';
GO
EXEC sp_addsrvrolemember 'username2', @rolename = N'dbcreator';

Thank you in advance!
0
I have been using this power shell command to create a text files that lists the currently installed programs on Windows 10 computers:

Get-WmiObject -Class Win32_Product | Select-Object -Property Name > C:\PCapps.txt

Open in new window


The problem is that this command lists only the names of the installed programs.

I would like to run a command that will display the complete list of everything that is displayed within the Programs and Features applet: Software name, publisher, installed on, size, & version.

What is the correct syntax of a command that will display all this information?
0
HI All,

I have this powershell script and I need find a secure way of storing the password. I've tried :

$response = Read-host "What's your password?" -AsSecureString 
$Password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($response)

Open in new window


and this will not work.

below is my script, how do I load the assembly, it prompts and error saying :

Unable to find type [Microsoft.VisualBasic.Interaction]. Make sure that the assembly that contains this type is loaded.
At line:1 char:1

this is the code
#Specifiy Local admin account name
$user = "mcadmin"
  
Add-Type -Assembly System.Web
$pass=[Web.Security.Membership]::GeneratePassword(20,0)
NET USER $user "$pass" /ADD /y
#Add user to local admin group
NET LOCALGROUP "Administrators" "$user" /add
#set password to never expire
WMIC USERACCOUNT WHERE "Name='$user'" SET PasswordExpires=FALSE
  
Write-Host "Username: $user" -foregroundcolor green -backgroundcolor black
Write-Host "Password: $pass" -foregroundcolor green -backgroundcolor black
Write-host "Server: $env:computername" -foregroundcolor green -backgroundcolor black

# Load the classes from KeePass.exe:
cd "\\smile01\Infrastructure\KeePass-2.34" | out-null
(Get-ChildItem -recurse $script:myinvocation.mycommand.path | Where-Object {($_.Extension -EQ ".dll") -or ($_.Extension -eq ".exe")} | ForEach-Object { $AssemblyName=$_.FullName; Try {[Reflection.Assembly]::LoadFile($AssemblyName) } 

Open in new window

0
Hi Experts,

I have this script tested and works as expected.  script checks the disks attached to server and checks the  drive label  of the disks and create a .txt file with the drive letter name ( such as "D drive.txt")  scripts is copied to  each server already and locally run.

For an example, if four disk found as D, E,Y,S on a local server, after running the script,  when I  go into each disk, I should have a .txt file saved in there as D drive.txt, E drive.txt , Y drive.txt and S drive.txt

batch script will be used on  mixture Windows OS versions. ( 2003 to 2012)

Issue: it works fine when script is run locally but when needed to run using PSexec, it produces different issues  even though script is on the local server and all PSexec should do is executing the script with remotely instead of logging into the each server. I have read on forums that vmic is not very friendly with PSExec, is there way to eliminate wmic from the script? here is forum talks about the issues it causes:  https://forum.sysinternals.com/psexec-hangs-when-running-wmicexe_topic14752.html

thanks in Advance
markerfile.txt
0
Hi experts

Require script to capture all root logins, through su - or direct login with root.


OS - CentOS 7
0
Hello Folks,

I have scripted a few apps to be installed among them I need to remove and old version of Flash therefore I have this file:
uninstall_flash_player.exe
so I'm using this line
uninstall_flash_player.exe -uninstall plugin

Open in new window

I have also used this line
start /wait uninstall_flash_player.exe -uninstall plugin

Open in new window

and this one
uninstall_flash_player.exe -uninstall

Open in new window


All the other applications I could install while triggering them w/ psexec, except for flash uninstall. it just stays still with the cursor blinking...
If i was to install it local then it would work, My ntid is part of the local group

Update:
so part of my script is like this:
if i do
start /wait c:\apps\uninstall_flash_player.exe -uninstall -force

Open in new window

then it would work but now im asking myself how come the other apps don't need the location since i'm launch the batch form the same folder as the script...?

any suggestions?
0
Hi. Looking to do the following.    Suggestions on best method please


A file server needs a secure folder for each user. (Like home folder but not)

Script would scan an ou. And any new user would get a folder created in there name.   And permissions added for just them and. Special group.

And thing similar already written ?
0
Hi People,

Can anyone here please share the PowerShell script for Exchange Server 2013 Mailbox Export to PST (one at a time to avoid server load issue)?

What I'd like to achieve:

1. The input from .CSV file or Excel Spreadsheet based on Firstname Lastname on column 1
Employee Name
John Smith
Matthew Porter
Qun Hin
Xan Vao
...

2. Export it as the same emailaddress.PST name format
3. limit the export to be just one at a time
4. send email when the export finish.

Thanks in advance.

I've read this website: https://technet.microsoft.com/en-us/library/ff607299(v=exchg.150).aspx but there is no
0
Ready to get started with anonymous questions?
LVL 9
Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

HI Guys,

 I need a powershell script to give me information on all the servers in our environment, the information I need are:

Server Name
OS Service Pack
DNS Domain
Disk Space (GB)
IP Address
MAC Address

what is the best way to achieve this?

Thank you in advance,
Kay
0
<target name="build" depends="updateMavenDependencies" description="Builds all extensions">
        <callback extname="" target="before_build"/>
        <build/>
        <callback extname="" target="after_build"/>
    </target>


Also what is extname= "" ?
0
Hi All,

I have another file which needs reading and converted to CSV.

I have attached the file and sample needed , anyhelp is appreciated.

Thank you

A
AP070717.txt
APSAMPLE.xlsx
0
Powershell command to list the information under Active Directory Tabs
In Active Directory, we have default tabs for AD objects(users and computers). We also have Customized tabs, that have been created by developers.
I would like to have a Powershell command that will give me information under  AD object (user or computer) tab, instead of manually searching for the object in AD and looking at the properties.

example, if I need to find a Canonical Name of Object under Object tab, I will need just to run Powershell command

Any help will be very much appreciated.

Thank you
0
Hello,
I have powershell code for winscp that uploads files from a local directory using a filter on files in the directory to a remote server.  I need code to determine if files are in use before they are uploaded. If a particular files is in use, I would like the code to skip the upload of that particular file and continue with the upload of the files not in use.  The code needs to accommodate applications that might be using the file that do not support file handles and any process that might have a lock on the file.

Any help would be greatly appreciated.

Thank you
Diammond
0
Hi Friends,

how to get only user name (domain username) below mentioned VBscript. if any possible please help me.

On Error Resume Next
Dim fso, ts
strOutput = "Local_status.csv"
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set input = fso.OpenTextFile("F:\serverlist.txt", 1, False)
Set ts = fso.CreateTextFile("F:\Local_status.csv")
fv = "File Version"
ts.WriteLine """ComputerName"",""GroupName"",""User Name"",""Type"",""Description"""

While Not input.AtEndOfStream
      strComputer = input.ReadLine
      Set colGroups = GetObject("WinNT://" & strComputer & "")
colGroups.Filter = Array("group")
For Each objGroup In colGroups
    If LCase(objGroup.Name) = "administrators" Then
        For Each objUser in objGroup.Members
              strUserPath = objUser.aDSPath
                  strUserPath = Replace(strUserPath, "WinNT://", "")
                  Pos         = InStr (strUserPath, strComputer)

                  If Pos > 0 Then
                        strUserPath = Mid(strUserPath, Pos)
                  End If
'                  WScript.Echo strUserPath
            ts.WriteLine """" & strComputer & """,""" & objGroup.Name & """,""" & strUserPath & """,""" & objUser.Class & """,""" & objUser.description & """"
        Next
    End If

Next
     
     
Wend

input.Close
ts.Close
Set ts = Nothing
Set fso = Nothing


MsgBox "Done. Please see " & strOutput
0
Hi
We send over a hundred invoices out at each two week billing cycle.  Currently the process is manual, and takes two accountants the better part of a day to send invoices out.

Invoices always follow the same naming convention, where the file name starts with the project code (example:  COS1012141 - client abc - invoice 24792.pdf"

We have a lookup table, that includes columns with project #, receipient email address, recipient name, etc.

What we're hoping to be able to do is point some application at a folder that has the 100+ PDF invoices, and somehow generate an email addressed to the receipient email address (from the lookup file), a greeting to the receipient name, and the respective attachment.  Then do that for each attachment.

I'm hoping there's an application out there somewhere, but worst case, is this something that can be built?

Open to suggestions.
0
I have linux server and i want to count pdf pages is colored or bw.

i have used imagemagic but it takes serverd down so can you help me with alternative way?
0
I'm building a form to do a quick search for real estate listings. There is something wrong with the formatting with the very last set of 'select options' however and i can't figure it out. I use WordPress so i'm new to forms anyway. I do know that the city values and property type values are correct. MLS ids are correct.

It's got to be something simple i just can't fix it.
works.txt
breaks-the-site.txt
codes-put-together.txt
0
Optimize your web performance
LVL 1
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Hello,
I have in a shell script, a variable that uses xmllint like this:

Xpath_querry = $ (xmllint --shell $ {xmlfile} << EOF
    Setrootns << EOF
    Xpath count (// defaultns: $ {parse_tag /} / defaultns: $ {tag}))

This worked but now, I have an EOF error in the console at run time.
Would anyone know another way to rewrite this variable (that the variable is used later in the script)?
0
I am attaching the converted script. Please help me in updating the ?PROBLEM? parts in the entire script. Its quire urgent.

Thank you.
installapps90.py
0
I installed php 7.1.5. Does it come with fast cgi or do I need to install that myself ?

Thanks,

Michael
0
I currently login to the time from website using the following script.


browser = webdriver.Chrome('E:/Shared Folders/Users/runnerjp/chromedriver/chromedriver.exe')
browser.get("https://www.timeform.com/horse-racing/account/sign-in?returnUrl=%2Fhorse-racing%2F") 
time.sleep(3)
username = browser.find_element_by_id("EmailAddress")
password = browser.find_element_by_id("Password")
username.send_keys("usr")
password.send_keys("pass")
login_attempt = browser.find_element_by_xpath("//input[@type='submit']")
time.sleep(3)
login_attempt.submit()

Open in new window


it works but I find using Chrome web driver is hammering my CPU. Is there an alternative code I could use that does not mean I need to physically load the page to sign in?
0
I'm wanting to have a neat and tidy package for multiple images (preferably png, or jpg if I must) that are used in an AutoIt GUI.  I'll be sharing it uncompiled, and don't want the mess of a boatload of individual image files.
They will all be the same size (probably 512x512) that will be used at some smaller resolution.

I'm not aware of any way around an icon (.ico) file displaying only the different sizes.  (use freeware Real World Icon Editor & Photoshop is avail)
If the best way is to create a .dll then I'll learn.  Please give me a bit o guidance (ie visual studio and learn about it (here))
Are there other good approaches?

What is the best way to store a bunch of images?
0
I want to use a MacOS script on OS Scierra, so that when I double click on an icon, it automatically sends an email to specific recipients every time, and it also includes an attachment named, for example 1.pdf.
This is using a network using Exchange 2010 on site.
Thanks to anyone that may help with this script, or program.
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.