Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. JustScriptIt

    Unable to read hash value in Powershell

    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...
  2. JustScriptIt

    Powershell - now to extract name of variable passed to script

    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...
  3. JustScriptIt

    How to Prevent Deadlocks

    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...
  4. JustScriptIt

    How to access row and column in CSV file

    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!
  5. JustScriptIt

    Silently turning off a service that requires password

    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...
  6. JustScriptIt

    Debug VBScript in MS Windows Server 2008

    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.
  7. JustScriptIt

    Script to delete filetype from particular directory

    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...
  8. JustScriptIt

    Permission Issue With Accessing Subfolder

    I modified the script from http://www.tek-tips.com/viewthread.cfm?qid=1635255 Option Explicit Dim fso Set fso = CreateObject("Scripting.FileSystemObject") Dim strDir, objDir strDir = "d:\" Set objDir = FSO.GetFolder(strDir) PrintFiles(objDir) Sub PrintFiles(pCurrentDir) Dim aItem...
  9. JustScriptIt

    How to script scenario where process fails to start on time

    I'm creating a script that involves stopping and starting a service. How do I handle a situation where service fails to start on time, say, after 2 minutes? Code to start service do Set colProcesses = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"). _ ExecQuery("Select * from...
  10. JustScriptIt

    Can authenticate to computer, but cannot connect to registry

    I am creating a script such that it deletes a registry value. First, I make sure I can ping it. Then, I make sure I can connect to registry value. Out of 20 computers, 9 of them are pingable, and two of them can connect to registry value. However, out of curiosity, I rdp'd into one of the...
  11. JustScriptIt

    VBScript to Clean Disk Space

    I am looking for the best way to create script such that 1. It cleans disk space of remote computer 2. Does this silently I found script here http://www.visualbasicscript.com/How-to-schedule-a-Disk-Cleanup-and-defrag-in-XP-via-VBScript-m66923.aspx but when I tried it on my computer, a prompt...
  12. JustScriptIt

    Script says Folder Exists even though it doesn't

    I am writing a script to check the existence of a folder. After declaring Option Explicit and using the command-line cscript //x script.vbs I still cannot figure out why the script says that a folder exists even though I can see it does not This is the snippit of code ' Can we...
  13. JustScriptIt

    How to Disconnect from Computer After Running Script

    I've been running diagnostic script on numerous computers. On the command line icon, I right click and select "Run As" However later on when I use the Sysinternals command psloggedon //[IP address] It displays that I am logged on locally. How do I avoid this? Or is there a way to...
  14. JustScriptIt

    Ping IP address, extract Computer Name

    I've been searching how to ping an IP address to extract the computer name. For instance, if I execute ping -n 2 -a [IP Address] I get the following output Pinging HostName.suffix.suffix.suffix [IP Address] with 32 bytes of data: Reply from IP Address: bytes=32 time=7ms TTL=121 Reply from...
  15. JustScriptIt

    Cannot Determine Cause of (null): 0x80041010 Error

    I modified code such that, it will bypass IP addresses it cannot make WMI connection to. However, there is one IP address which causes the program to throw an error Whether it is several IP addresses, or that one particular IP address in the list, it causes the error on line 65...
  16. JustScriptIt

    Why Can't I Reset Values for Next Loop Iteration

    I've spent a week trying to troubleshoot my code. At first, I thought the computer was pointed to the wrong DNS server, and that's why I'm getting inconsistent output. But, when I try each IP address individually, I either get the accurate result, or no result at all (because computer cannot...
  17. JustScriptIt

    Discrepancy in Computer Name

    I am writing a script such that, it will display computer name based on IP address Set objWMISvc = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colItems = objWMISvc.ExecQuery( "Select * from Win32_ComputerSystem", ,48 ) For Each objItem in...
  18. JustScriptIt

    Why Can't I Split A String

    I am trying to split the string: D:\PROGRA~1\COMMON~1\SYMANT~1\VIRUSD~1\20111208.001 I wrote the following code strKeyPath = "SOFTWARE\Symantec\SharedDefs" strValueName = "DEFWATCH_10" oReg.GetStringValue _ HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue strVirus = strValue...
  19. JustScriptIt

    What WMI services, etc, do I use to delete a temporarily created file

    I am trying to create a script that deletes a file that is generated in the process of a service is shutting down. Once the service has shut down, the file disappears. That means, the script must 1. Detect the presence of a file 2. Then it can delete it What WMI tools do I use? Are there other...
  20. JustScriptIt

    Same script on different domain/workgroup gives different results

    I have created the following script to troubleshoot issue on our network: Option Explicit Dim objInputFSO, objOutputFSO, objFile Dim strInputFile, strData, arrLines, strLine Dim objWMISvc, colItems, objItem, strComputerDomain, strMember Dim strComputer, strKeyPath, strValueName, oReg...

Part and Inventory Search

Back
Top