Search Results

Search found 22521 results on 901 pages for 'script fu'.

Page 9/901 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Script to create ODBC connection

    - by Mathew
    I need to deploy some software through SMS/SCCM and the software requires that an ODBC connection be created in Windows. The connection information I was given requires a user name and password. I have a batch script to import the connection information into the registry, however I don't know how to go about putting the user name and password in. I'd like to script this or put it in some kind of distributable package. Thanks, -Mathew

    Read the article

  • C# autocomplete not working for Script# in visual studio

    - by samwa
    Hi I'm using the fantastic project Script# (http://projects.nikhilk.net/ScriptSharp) I can't seem to get the autocomplete feature in VisualStudio 2008 working the .scriptlet files appear as plain text with no code formatting at all the version of Script# I am using is 0.5.6 I am opening the samples project and looking at HelloWorld.scriptlet Cheers Sam

    Read the article

  • Command passed as argument to shell script

    - by raj_arni
    Hi, I want to pass a command to a shell script. This command is a grep command. While executing I am getting the following errors, please help: myscript.sh "egrep 'ERROR|FATAL' \*20100428\*.log | grep -v aString" myscript.sh is a simple script: #!/bin/ksh cd log $1 the errors are: egrep: can't open | egrep: can't open grep egrep: can't open -v egrep: can't open aString Error is because egrap sees |, grep, -v and aString as arguments.

    Read the article

  • Whats wrong with my script??

    - by John Augst
    Hi guys; Could you tell me whats wrong with this script: I think the error is in IF statment <script> productID=new Array() variaveis=location.search.replace(/\x3F/,"").replace(/\x2B/g," ").split("&") if(variaveis!=""){ for(i=0;iflash1"); } else if (flash = "flash2") { document.write("flash2"); } else { document.write("another"); }

    Read the article

  • validation functions in google apps script is not working properly

    - by chocka
    I create a i/p form in google site using Apps Script and i did the validation using the Apps Script coding. Validation functions available in Apps script is not satisfying all the possibility of checking the error. function validate(e) { var app = UiApp.getActiveApplication(); var flag=0; var text = app.getElementById('name'); var textrequired = app.getElementById('namerequired'); var number = app.getElementById('number'); var numberrequired = app.getElementById('numberrequired'); var email = app.getElementById('email'); var emailrequired = app.getElementById('emailrequired'); var submit = app.getElementById('submit_button'); var valid = app.createClientHandler() .validateNumber(number) .validateNotInteger(text) .validateEmail(email) .forTargets(submit).setEnabled(true) .forTargets(number,text,email).setStyleAttribute("color","black") .forTargets(numberrequired,textrequired,emailrequired).setText('*').setStyleAttribute("color", "red").setVisible(true); var invalidno = app.createClientHandler().validateNotNumber(number).validateMatches(number, '').forTargets(number).setStyleAttribute("color", "red").forTargets(submit).setEnabled(false).forTargets(numberrequired).setText('Please Enter a Valid No.').setStyleAttribute("color", "red").setVisible(true); var validno = app.createClientHandler().validateNumber(number).forTargets(number).setStyleAttribute("color","black").forTargets(numberrequired).setText('*').setStyleAttribute("color", "red").setVisible(true); var invalidText=app.createClientHandler().validateNumber(text).validateMatches(text, '').forTargets(text).setStyleAttribute("color", "red").forTargets(submit).setEnabled(false).forTargets(textrequired).setText('Please Enter a Valid Name.').setStyleAttribute("color", "red").setVisible(true); var validText=app.createClientHandler().validateNotNumber(text).forTargets(text).setStyleAttribute("color","black").forTargets(textrequired).setText('*').setStyleAttribute("color", "red").setVisible(true); var invalidemail=app.createClientHandler().validateNotEmail(email).validateMatches(email, '').forTargets(email).setStyleAttribute("color", "red").forTargets(submit).setEnabled(false).forTargets(emailrequired).setText('Please Enter a Valid Mail-Id.').setStyleAttribute("color", "red").setVisible(true); var validemail=app.createClientHandler().validateEmail(email).forTargets(email).setStyleAttribute("color","black").forTargets(emailrequired).setText('*').setStyleAttribute("color", "red").setVisible(true); number.addKeyPressHandler(invalidno).addKeyPressHandler(validno).addKeyPressHandler(valid).addKeyPressHandler(invalidText).addKeyPressHandler(invalidemail); text.addKeyPressHandler(invalidText).addKeyPressHandler(validText).addKeyPressHandler(valid).addKeyPressHandler(invalidno).addKeyPressHandler(invalidemail); email.addKeyPressHandler(invalidemail).addKeyPressHandler(validemail).addKeyPressHandler(valid).addKeyPressHandler(invalidno).addKeyPressHandler(invalidText); if (text == ''){flag = 1;} if (email == ''){flag = 1;} if (number == ''){flag = 1;} if(flag == 1){submit.setEnabled(false);} return app; } I just placed my Validation function using Apps Script. I don't know why its not satisfying all the possibilities of the validation. And also i have to do is to enable the submit button after all the fields satisfy the validation. After once it enabled, if i make any error in any field it will not get disable correctly. I wrote the coding correctly i think so. Please take a look at my validation function and give me some suggestion to make it possible. Please guide me, Thanks & Regards, chocka.

    Read the article

  • Script Bash and History Unix

    - by user1107078
    i just start to use Script bash on UNIX and i didnt find a solution to write the first command in the history which start , for example , with ls. If i write in the shell history !ls it works but when i'm going to create a script it wont work. This is my example code #!/bin/bash set -o | grep history set -o history #echo "HISTFILE is $HISTFILE" #history "!ls"; #history #!ls history #it works Another Question why echo "HISTFILE is $HISTFILE" print me only HISTFILE is ?? Thanks

    Read the article

  • writing a shell script if statement to check for directory

    - by user1553248
    I need to write a script that will recreate my opt folder if it gets deleted when I remove a package from it. Here's a link to my previous post: dpkg remove to stop processes Now, the issue I'm running into could be better described here: http://lists.debian.org/debian-devel/2006/03/msg00242.html I was thinking of just adding a postrem script which checks if an opt directory exists, and if not, creates one. My experience with shell scripts is pretty limited though..

    Read the article

  • PHP see POST/GET values made to script dynamically

    - by minimalpop
    Hi, I've been testing a PHP script that I'm posting values to every few seconds (latitude and longitude to be specific) and am wondering if there's an easier way to see what values are being sent to the script. Right now I'm writing the data to a txt file on my server, and refreshing the page every so often to see what values have been posted recently. Is there a way to just see what's going on behind the scenes (in terminal, perhaps)? Thanks.

    Read the article

  • Ubuntu Bash Script changing file names chronologicaly

    - by Manifold
    I have this bash script where I am trying to change all *.txt files in a directory to their date of last modification. This is the script: #!/bin/bash # Renames the .txt files to the date modified # FROM: foo.txt Created on: 2012-04-18 18:51:44 # TO: 20120418_185144.txt for i in *.txt do mod_date=$(stat --format %y "$i"|awk '{print $1"_"$2}'|cut -f1 -d'.'|sed 's/[: -]//g') mv "$i" "$mod_date".txt done The error I am getting is: renamer.sh: 6: renamer.sh: Syntax error: word unexpected (expecting "do") Any help would be greatly appreciated. Thank you for your time.

    Read the article

  • Implicit and Explicit implementations for Multiple Interface inheritance

    Following C#.NET demo explains you all the scenarios for implementation of Interface methods to classes. There are two ways you can implement a interface method to a class. 1. Implicit Implementation 2. Explicit Implementation. Please go though the sample. using System;   namespace ImpExpTest { class Program { static void Main(string[] args) { C o3 = new C(); Console.WriteLine(o3.fu());   I1 o1 = new C(); Console.WriteLine(o1.fu());   I2 o2 = new C(); Console.WriteLine(o2.fu());   var o4 = new C(); //var is considered as C Console.WriteLine(o4.fu());   var o5 = (I1)new C(); //var is considered as I1 Console.WriteLine(o5.fu());   var o6 = (I2)new C(); //var is considered as I2 Console.WriteLine(o6.fu());   D o7 = new D(); Console.WriteLine(o7.fu());   I1 o8 = new D(); Console.WriteLine(o8.fu());   I2 o9 = new D(); Console.WriteLine(o9.fu()); } }   interface I1 { string fu(); }   interface I2 { string fu(); }   class C : I1, I2 { #region Imicitly Defined I1 Members public string fu() { return "Hello C"; } #endregion Imicitly Defined I1 Members   #region Explicitly Defined I1 Members   string I1.fu() { return "Hello from I1"; }   #endregion Explicitly Defined I1 Members   #region Explicitly Defined I2 Members   string I2.fu() { return "Hello from I2"; }   #endregion Explicitly Defined I2 Members }   class D : C { #region Imicitly Defined I1 Members public string fu() { return "Hello from D"; } #endregion Imicitly Defined I1 Members } }.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }Output:-Hello C Hello from I1 Hello from I2 Hello C Hello from I1 Hello from I2 Hello from D Hello from I1 Hello from I2 span.fullpost {display:none;}

    Read the article

  • Modify shell script to monitor/ping multiple ip addresses

    - by Alex
    Alright so I need to constantly monitor multiple routers and computers, to make sure they remain online. I have found a great script here that will notify me via growl(so i can get instant notifications on my phone) if a single ip cannot be pinged. I have been attempting to modify the script to ping multiple addresses, with little luck. I'm having trouble trying to figure out how to ping a down server while the script keeps watching the online servers. any help would be greatly appreciated. I haven't done much shell scripting so this is quite new to me. Thanks #!/bin/sh #Growl my Router alive! #2010 by zionthelion73 [at] gmail . com #use it for free #redistribute or modify but keep these comments #not for commercial purposes iconpath="/path/to/router/icon/file/internet.png" # path must be absolute or in "./path" form but relative to growlnotify position # document icon is used, not document content # Put the IP address of your router here localip=192.168.1.1 clear echo 'Router avaiability notification with Growl' #variable avaiable=false com="################" #comment prefix for logging porpouse while true; do if $avaiable then echo "$com 1) $localip avaiable $com" echo "1" while ping -c 1 -t 2 $localip do sleep 5 done growlnotify -s -I $iconpath -m "$localip is offline" avaiable=false else echo "$com 2) $localip not avaiable $com" #try to ping the router untill it come back and notify it while !(ping -c 1 -t 2 $localip) do echo "$com trying.... $com" sleep 5 done echo "$com found $localip $com" growlnotify -s -I $iconpath -m "$localip is online" avaiable=true fi sleep 5 done

    Read the article

  • echo -e acts differently when run in a script by root on ubuntu

    - by ekrub
    When running a bash script on ubuntu 9.10, I get different behavior from bash echo's "-e" option depending on whether or not I'm running as root. Consider this script: $ cat echo-test if [ "`whoami`" = "root" ]; then echo "Running as root" fi echo Testing /bin/echo -e /bin/echo -e "foo\nbar" echo Testing bash echo -e echo -e "foo\nbar" When run as non-root user, I see this output: $ ./echo-test Testing /bin/echo -e foo bar Testing bash echo -e foo bar When run as root, I see this output: $ sudo ./echo-test Running as root Testing /bin/echo -e foo bar Testing bash echo -e -e foo bar Notice the "-e" being echoed in the last case ("-e foo" instead of "foo" on the second-to-last line). When running a script as root, the echo command runs as if "-e" was given and, if -e is given, the option itself is echoed. I can understand some subtle differences in behavior between /bin/echo and bash echo, but I would expect bash echo to behave the same no matter which user invokes it. Anyone know why this is the case? Is this a bug in bash echo? FYI -- I'm running GNU bash, version 4.0.33(1)-release (x86_64-pc-linux-gnu)

    Read the article

  • PHP script stops running arbitrarily with no errors.

    - by RobHardgood
    I was working on a fairly long script that seemed to stop running after about 20 minutes. After days of trying to figure out why, I decided to make a very simple script to see how long it would run without any complex code to confuse me. I found that the same thing was happening with this simple infinite loop. At some point between 15 and 25 minutes of running, it simply stopped. There is no error output at all. The bottom of the browser simply says "Done" and nothing else is processed. I've been over every single possible thing I could think of... set_time_limit, session.gc_maxlifetime in the php.ini as well as memory_limit and max_execution_time. The point that the script is stopped is never consistent. Sometimes it will stop at 15 minutes, sometimes 22 minutes, sometimes 17... But it's always long enough to be a PITA to test. Please, any help would be greatly appreciated. It is hosted on a 1and1 server. I contacted them and they couldn't help me... but I have a feeling they just didn't know enough.

    Read the article

  • How to import properties of an external API into Script#

    - by AndrewDotHay
    I'm using Script# inside Visual Studio 2010 to import the API for the HTML5 Canvas element. Its working great for things like FillRect(), MoveTo(), LineTo() and so on. I've declared the following interface and then I can code against it in C#. Then, Script# converts it to JavaScript nicely. public interface CanvasContext { void FillRect(int x, int y, int width, int height); void BeginPath(); void MoveTo(int x, int y); void LineTo(int x, int y); void Stroke(); void FillText(string text, int x, int y); } I want to include the StrokeStyle property that takes a simple string. The following interface definition produces a prefix in the JavaScript, which causes it to fail. string StrokeStyle { get; set; } string Font { get; set; } The previous property will create this JavaScript: ctx.set_strokeStyle('#FF0'); How can I get Script# to generate the simple assignment properties of the canvas context without the get_/set_ prefix?

    Read the article

  • PowerShell Script to Enumerate SharePoint 2010 or 2013 Permissions and Active Directory Group Membership

    - by Brian T. Jackett
    Originally posted on: http://geekswithblogs.net/bjackett/archive/2013/07/01/powershell-script-to-enumerate-sharepoint-2010-or-2013-permissions-and.aspx   In this post I will present a script to enumerate SharePoint 2010 or 2013 permissions across the entire farm down to the site (SPWeb) level.  As a bonus this script also recursively expands the membership of any Active Directory (AD) group including nested groups which you wouldn’t be able to find through the SharePoint UI.   History     Back in 2009 (over 4 years ago now) I published one my most read blog posts about enumerating SharePoint 2007 permissions.  I finally got around to updating that script to remove deprecated APIs, supporting the SharePoint 2010 commandlets, and fixing a few bugs.  There are 2 things that script did that I had to remove due to major architectural or procedural changes in the script. Indenting the XML output Ability to search for a specific user    I plan to add back the ability to search for a specific user but wanted to get this version published first.  As for indenting the XML that could be added but would take some effort.  If there is user demand for it (let me know in the comments or email me using the contact button at top of blog) I’ll move it up in priorities.    As a side note you may also notice that I’m not using the Active Directory commandlets.  This was a conscious decision since not all environments have them available.  Instead I’m relying on the older [ADSI] type accelerator and APIs.  It does add a significant amount of code to the script but it is necessary for compatibility.  Hopefully in a few years if I need to update again I can remove that legacy code.   Solution    Below is the script to enumerate SharePoint 2010 and 2013 permissions down to site level.  You can also download it from my SkyDrive account or my posting on the TechNet Script Center Repository. SkyDrive TechNet Script Center Repository http://gallery.technet.microsoft.com/scriptcenter/Enumerate-SharePoint-2010-35976bdb   001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 ########################################################### #DisplaySPWebApp8.ps1 # #Author: Brian T. Jackett #Last Modified Date: 2013-07-01 # #Traverse the entire web app site by site to display # hierarchy and users with permissions to site. ########################################################### function Expand-ADGroupMembership {     Param     (         [Parameter(Mandatory=$true,                    Position=0)]         [string]         $ADGroupName,         [Parameter(Position=1)]         [string]         $RoleBinding     )     Process     {         $roleBindingText = ""         if(-not [string]::IsNullOrEmpty($RoleBinding))         {             $roleBindingText = " RoleBindings=`"$roleBindings`""         }         Write-Output "<ADGroup Name=`"$($ADGroupName)`"$roleBindingText>"         $domain = $ADGroupName.substring(0, $ADGroupName.IndexOf("\") + 1)         $groupName = $ADGroupName.Remove(0, $ADGroupName.IndexOf("\") + 1)                                     #BEGIN - CODE ADAPTED FROM SCRIPT CENTER SAMPLE CODE REPOSITORY         #http://www.microsoft.com/technet/scriptcenter/scripts/powershell/search/users/srch106.mspx         #GET AD GROUP FROM DIRECTORY SERVICES SEARCH         $strFilter = "(&(objectCategory=Group)(name="+($groupName)+"))"         $objDomain = New-Object System.DirectoryServices.DirectoryEntry         $objSearcher = New-Object System.DirectoryServices.DirectorySearcher         $objSearcher.SearchRoot = $objDomain         $objSearcher.Filter = $strFilter         # specify properties to be returned         $colProplist = ("name","member","objectclass")         foreach ($i in $colPropList)         {             $catcher = $objSearcher.PropertiesToLoad.Add($i)         }         $colResults = $objSearcher.FindAll()         #END - CODE ADAPTED FROM SCRIPT CENTER SAMPLE CODE REPOSITORY         foreach ($objResult in $colResults)         {             if($objResult.Properties["Member"] -ne $null)             {                 foreach ($member in $objResult.Properties["Member"])                 {                     $indMember = [adsi] "LDAP://$member"                     $fullMemberName = $domain + ($indMember.Name)                                         #if($indMember["objectclass"]                         # if child AD group continue down chain                         if(($indMember | Select-Object -ExpandProperty objectclass) -contains "group")                         {                             Expand-ADGroupMembership -ADGroupName $fullMemberName                         }                         elseif(($indMember | Select-Object -ExpandProperty objectclass) -contains "user")                         {                             Write-Output "<ADUser>$fullMemberName</ADUser>"                         }                 }             }         }                 Write-Output "</ADGroup>"     } } #end Expand-ADGroupMembership # main portion of script if((Get-PSSnapin -Name microsoft.sharepoint.powershell) -eq $null) {     Add-PSSnapin Microsoft.SharePoint.PowerShell } $farm = Get-SPFarm Write-Output "<Farm Guid=`"$($farm.Id)`">" $webApps = Get-SPWebApplication foreach($webApp in $webApps) {     Write-Output "<WebApplication URL=`"$($webApp.URL)`" Name=`"$($webApp.Name)`">"     foreach($site in $webApp.Sites)     {         Write-Output "<SiteCollection URL=`"$($site.URL)`">"                 foreach($web in $site.AllWebs)         {             Write-Output "<Site URL=`"$($web.URL)`">"             # if site inherits permissions from parent then stop processing             if($web.HasUniqueRoleAssignments -eq $false)             {                 Write-Output "<!-- Inherits role assignments from parent -->"             }             # else site has unique permissions             else             {                 foreach($assignment in $web.RoleAssignments)                 {                     if(-not [string]::IsNullOrEmpty($assignment.Member.Xml))                     {                         $roleBindings = ($assignment.RoleDefinitionBindings | Select-Object -ExpandProperty name) -join ","                         # check if assignment is SharePoint Group                         if($assignment.Member.XML.StartsWith('<Group') -eq "True")                         {                             Write-Output "<SPGroup Name=`"$($assignment.Member.Name)`" RoleBindings=`"$roleBindings`">"                             foreach($SPGroupMember in $assignment.Member.Users)                             {                                 # if SharePoint group member is an AD Group                                 if($SPGroupMember.IsDomainGroup)                                 {                                     Expand-ADGroupMembership -ADGroupName $SPGroupMember.Name                                 }                                 # else SharePoint group member is an AD User                                 else                                 {                                     # remove claim portion of user login                                     #Write-Output "<ADUser>$($SPGroupMember.UserLogin.Remove(0,$SPGroupMember.UserLogin.IndexOf("|") + 1))</ADUser>"                                     Write-Output "<ADUser>$($SPGroupMember.UserLogin)</ADUser>"                                 }                             }                             Write-Output "</SPGroup>"                         }                         # else an indivdually listed AD group or user                         else                         {                             if($assignment.Member.IsDomainGroup)                             {                                 Expand-ADGroupMembership -ADGroupName $assignment.Member.Name -RoleBinding $roleBindings                             }                             else                             {                                 # remove claim portion of user login                                 #Write-Output "<ADUser>$($assignment.Member.UserLogin.Remove(0,$assignment.Member.UserLogin.IndexOf("|") + 1))</ADUser>"                                                                 Write-Output "<ADUser RoleBindings=`"$roleBindings`">$($assignment.Member.UserLogin)</ADUser>"                             }                         }                     }                 }             }             Write-Output "</Site>"             $web.Dispose()         }         Write-Output "</SiteCollection>"         $site.Dispose()     }     Write-Output "</WebApplication>" } Write-Output "</Farm>"      The output from the script can be sent to an XML which you can then explore using the [XML] type accelerator.  This lets you explore the XML structure however you see fit.  See the screenshot below for an example.      If you do view the XML output through a text editor (Notepad++ for me) notice the format.  Below we see a SharePoint site that has a SharePoint group Demo Members with Edit permissions assigned.  Demo Members has an AD group corp\developers as a member.  corp\developers has a child AD group called corp\DevelopersSub with 1 AD user in that sub group.  As you can see the script recursively expands the AD hierarchy.   Conclusion    It took me 4 years to finally update this script but I‘m happy to get this published.  I was able to fix a number of errors and smooth out some rough edges.  I plan to develop this into a more full fledged tool over the next year with more features and flexibility (copy permissions, search for individual user or group, optional enumerate lists / items, etc.).  If you have any feedback, feature requests, or issues running it please let me know.  Enjoy the script!         -Frog Out

    Read the article

  • Script for run script on vbs

    - by user31568
    Hello everybody I have a script on vbscript Dim WSHShell, WinDir, Value, wshProcEnv, fso, Spath Set WSHShell = CreateObject("WScript.Shell") Dim objFSO, objFileCopy Dim strFilePath, strDestination Const OverwriteExisting = True Set objFSO = CreateObject("Scripting.FileSystemObject") Set windir = objFSO.getspecialfolder(0) objFSO.CopyFile "\dv.rt.ru\SYSVOL\DV.RT.RU\scripts\shutdown.vbs", windir&"\", OverwriteExisting strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\" _ & strComputer & "\root\cimv2") JobID = "1" Set colScheduledJobs = objWMIService.ExecQuery _ ("Select * from Win32_ScheduledJob") For Each objJob in colScheduledJobs objJob.Delete Next Set objNewJob = objWMIService.Get("Win32_ScheduledJob") errJobCreate = objNewJob.Create _ (windir & "\shutdown.vbs", "**093000.000000+660", _ True, 1 OR 2 OR 4 OR 8 OR 16 OR 32 OR 64, ,True, JobId) How make that shutdown.vbs not run once at 9:30 but run for 9:30 to 12:00

    Read the article

  • Script for run script on vbs

    - by user35729
    Hello everybody I have a script on vbscript Dim WSHShell, WinDir, Value, wshProcEnv, fso, Spath Set WSHShell = CreateObject("WScript.Shell") Dim objFSO, objFileCopy Dim strFilePath, strDestination Const OverwriteExisting = True Set objFSO = CreateObject("Scripting.FileSystemObject") Set windir = objFSO.getspecialfolder(0) objFSO.CopyFile "\dv.rt.ru\SYSVOL\DV.RT.RU\scripts\shutdown.vbs", windir&"\", OverwriteExisting strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\" _ & strComputer & "\root\cimv2") JobID = "1" Set colScheduledJobs = objWMIService.ExecQuery _ ("Select * from Win32_ScheduledJob") For Each objJob in colScheduledJobs objJob.Delete Next Set objNewJob = objWMIService.Get("Win32_ScheduledJob") errJobCreate = objNewJob.Create _ (windir & "\shutdown.vbs", "**093000.000000+660", _ True, 1 OR 2 OR 4 OR 8 OR 16 OR 32 OR 64, ,True, JobId) How make that shutdown.vbs not run once at 9:30 but run for 9:30 to 12:00

    Read the article

  • Script for run script

    - by user31568
    Hello everyone. There is script: Dim WSHShell, WinDir, Value, wshProcEnv, fso, Spath Set WSHShell = CreateObject("WScript.Shell") Dim objFSO, objFileCopy Dim strFilePath, strDestination Const OverwriteExisting = True Set objFSO = CreateObject("Scripting.FileSystemObject") Set windir = objFSO.getspecialfolder(0) objFSO.CopyFile "\dv.rt.ru\SYSVOL\DV.RT.RU\scripts\shutdown.vbs", windir&"\", OverwriteExisting strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\" _ & strComputer & "\root\cimv2") JobID = "1" Set colScheduledJobs = objWMIService.ExecQuery _ ("Select * from Win32_ScheduledJob") For Each objJob in colScheduledJobs objJob.Delete Next Set objNewJob = objWMIService.Get("Win32_ScheduledJob") errJobCreate = objNewJob.Create _ (windir & "\shutdown.vbs", "**093000.000000+660", _ True, 1 OR 2 OR 4 OR 8 OR 16 OR 32 OR 64, ,True, JobId) How make that shutdown.vbs run not at 9:00 once, but run for 9:00 to 12:00 Thanks

    Read the article

  • PowerShell Script To Find Where SharePoint 2007 Features Are Activated

    - by Brian T. Jackett
    Recently I posted a script to find where SharePoint 2010 Features Are Activated.  I built the original version to use SharePoint 2010 PowerShell commandlets as that saved me a number of steps for filtering and gathering features at each level.  If there was ever demand for a 2007 version I could modify the script to handle that by using the object model instead of commandlets.  Just the other week a fellow SharePoint PFE Jason Gallicchio had a customer asking about a version for SharePoint 2007.  With a little bit of work I was able to convert the script to work against SharePoint 2007.   Solution    Below is the converted script that works against a SharePoint 2007 farm.  Note: There appears to be a bug with the 2007 version that does not give accurate results against a SharePoint 2010 farm.  I ran the 2007 version against a 2010 farm and got fewer results than my 2010 version of the script.  Discussing with some fellow PFEs I think the discrepancy may be due to sandboxed features, a new concept in SharePoint 2010.  I have not had enough time to test or confirm.  For the time being only use the 2007 version script against SharePoint 2007 farms and the 2010 version against SharePoint 2010 farms.    Note: This script is not optimized for medium to large farms.  In my testing it took 1-3 minutes to recurse through my demo environment.  This script is provided as-is with no warranty.  Run this in a smaller dev / test environment first. 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 function Get-SPFeatureActivated { # see full script for help info, removed for formatting [CmdletBinding()] param(     [Parameter(position = 1, valueFromPipeline=$true)]     [string]     $Identity )#end param     Begin     {         # load SharePoint assembly to access object model         [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")             # declare empty array to hold results. Will add custom member for Url to show where activated at on objects returned from Get-SPFeature.         $results = @()                 $params = @{}     }     Process     {         if([string]::IsNullOrEmpty($Identity) -eq $false)         {             $params = @{Identity = $Identity}         }                 # create hashtable of farm features to lookup definition ids later         $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local                         # check farm features         $results += ($farm.FeatureDefinitions | Where-Object {$_.Scope -eq "Farm"} | Where-Object {[string]::IsNullOrEmpty($Identity) -or ($_.DisplayName -eq $Identity)} |                          % {Add-Member -InputObject $_ -MemberType noteproperty -Name Url -Value ([string]::Empty) -PassThru} |                          Select-Object -Property Scope, DisplayName, Id, Url)                 # check web application features         $contentWebAppServices = $farm.services | ? {$_.typename -like "Windows SharePoint Services Web Application"}                 foreach($webApp in $contentWebAppServices.WebApplications)         {             $results += ($webApp.Features | Select-Object -ExpandProperty Definition | Where-Object {[string]::IsNullOrEmpty($Identity) -or ($_.DisplayName -eq $Identity)} |                          % {Add-Member -InputObject $_ -MemberType noteproperty -Name Url -Value $webApp.GetResponseUri(0).AbsoluteUri -PassThru} |                          Select-Object -Property Scope, DisplayName, Id, Url)                         # check site collection features in current web app             foreach($site in ($webApp.Sites))             {                 $results += ($site.Features | Select-Object -ExpandProperty Definition | Where-Object {[string]::IsNullOrEmpty($Identity) -or ($_.DisplayName -eq $Identity)} |                                  % {Add-Member -InputObject $_ -MemberType noteproperty -Name Url -Value $site.Url -PassThru} |                                  Select-Object -Property Scope, DisplayName, Id, Url)                                 # check site features in current site collection                 foreach($web in ($site.AllWebs))                 {                     $results += ($web.Features | Select-Object -ExpandProperty Definition | Where-Object {[string]::IsNullOrEmpty($Identity) -or ($_.DisplayName -eq $Identity)} |                                      % {Add-Member -InputObject $_ -MemberType noteproperty -Name Url -Value $web.Url -PassThru} |                                      Select-Object -Property Scope, DisplayName, Id, Url)                                                        $web.Dispose()                 }                 $site.Dispose()             }         }     }     End     {         $results     } } #end Get-SPFeatureActivated Get-SPFeatureActivated   Conclusion    I have posted this script to the TechNet Script Repository (click here).  As always I appreciate any feedback on scripts.  If anyone is motivated to run this 2007 version script against a SharePoint 2010 to see if they find any differences in number of features reported versus what they get with the 2010 version script I’d love to hear from you.         -Frog Out

    Read the article

  • Run a PHP-script from a PHP-script without blocking

    - by Nicklas Ansman
    I'm building a spider which will traverse various sites and data mining them. Since I need to get each page separately this could take a VERY long time (maybe 100 pages). I've already set the set_time_limit to be 2 minutes per page but it seems like apache will kill the script after 5 minutes no matter. This isn't usually a problem since this will run from cron or something similar which does not have this time limit. However I would also like the admins to be able to start a fetch manually via a HTTP-interface. It is not important that apache is kept alive for the full duration, I'm, going to use AJAX to trigger a fetch and check back once in a while with AJAX. My problem is how to start the fetch from within a PHP-script without the fetch being terminated when the script calling it dies. Maybe I could use system('script.php &') but I'm not sure it will do the trick. Any other ideas?

    Read the article

  • wait for the second VB script untill ended from primary VB script

    - by yael
    Hi I have VB script that run second VB script The second VB script ask some questions from the input box My problem is that “MyShell.Run” not wait until SecondVBscript.vbs will ended And the Other VB syntax run immodestly also Need to wait for MyShell.Run process ended and then perform the Other VB syntax How can I do that? Set MyShell = Wscript.CreateObject("WScript.Shell") MyShell.Run " C:\Program Files\SecondVBscript.vbs" Set MyShell = Nothing Other VB syntax

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >