I am writing a simple script to get more familiar with powershell.
This script reads input parameters into a hash
$states = @($args)
$states
write-host Color is $states.color
On the command-line, I set the following values$shape = 'circle'; $color = 'pink'; $size = 'large'I then invoke the...
I am writing powershell script to interface with an external software program our company is using
The script needs to take in value of the input parameter and do something.
But the problem is, this external software pushes many input parameters with the names
•sender-email
•sender-ip...
Hello,
I am scripting in powershell to read from table, and then update table.
It works very well - except when another user or program is trying to read or update the table at the same time.
This is unavoidable, so I would like to know how to prevent transaction deadlocks.
Here is code to...
I think I am not explaning clearly.
I am looking to create a powershell script that does the following
1. Reads an IP address from an MS SQL database
2. Opens the CSV file of the IP addresses
3. Determine which range the IP address falls in
4. Perform the necessary updates based on which range...
Hello,
I tried the above code, and got the following output
http://www.mediafire.com/i/?mq33lw3ujqb5hj9
I am unable to grasp how to access 1st row, 2nd column, or 2nd row, 4th column, etc, etc.
Please help.
I have powershell code,
$file = Import-CSV C:\PS\IP_list.csv
Write-Output $file
And I have output
http://www.mediafire.com/i/?oldomqsvm9w67wl
I am unable to figure out how to access 1st row, 2nd column, or 2nd row, 4th column.
Help!
I am testing a vbscript to turn off a service that requires a password:
'Stop smc.exe service
objWMISvc.Create(strPath & "\smc.exe -stop our_secret_password")
This works really well, but here's the problem. On the test computer where I am stopping smc.exe, I see a pop-up that prompts the...
When I attempt to debug a VBScript in MS Windows Server 2008 via command-line
cscript //x script.vbs
The debugger never launches. Is there another utility to download.
On this particular Windows Server 2008, under Services, I do see that Windows Management Instrumentation has started.
I changed the code around delete as followed
' Turn on error checking in case file is in use
On Error Resume Next
'Delete the file
objDelFile.DeleteFile sBaseName,true
' Turn off error checking in case file is in use
On Error Goto 0
So far, no hiccups
Which On Error Resume Next do I delete, and what error handling do I substitute it with?
Earlier today, the program raised run-time errors because certain files, folders weren't accessible.
I'd like to script to continue execution even if certain files, folders cannot be accessed.
HELP!
I am trying to build a script that eventually deletes tmp, err, files from remote computers.
There are certain directories that Disk Cleanup just cannot touch, especially if these folders are from other programs installed on Windows.
Right now, I'm trying this on my own computer, and it is...
It worked. See modified subroutine for PrintFiles
Sub PrintFiles(pCurrentDir)
Dim aItem, sParentName, sBaseName
For Each aItem In pCurrentDir.Files
If fso.GetExtensionName(aItem.Path) = "vbs" Then
If Right(fso.GetParentFolderName(aItem.path),1) = "\" Then
sParentName =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.