1. Set objWMIService = GetObject("winmgmts:") Set fso = CreateObject("Scripting.FileSystemObject") Set InputFile = fso.OpenTextFile("patches.Txt") Set outFile = fso.OpenTextFile("output.csv", 2, True) Do Until (InputFile.atEndOfStream) strHotFixId = InputFile.ReadLine outFile.Write strHotFixId & ",Read more

    Set objWMIService = GetObject("winmgmts:")
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set InputFile = fso.OpenTextFile("patches.Txt")
    Set outFile = fso.OpenTextFile("output.csv", 2, True)
    
    Do Until (InputFile.atEndOfStream)
      strHotFixId = InputFile.ReadLine
      outFile.Write strHotFixId & ","
      Set colItems = objWMIService.ExecQuery( _
      "Select InstalledOn from Win32_QuickFixEngineering Where HotFixID ='" & strHotFixId & "'")
      
      If colItems.Count > 0 Then
        For Each objItem In colItems
          outFile.WriteLine objItem.InstalledOn
        Next
      Else
        outFile.WriteLine "Not Installed"
      End If
    Loop
    
    See less
    • 0
  2. Its just a hunch, but does this give the same error: echo test 0>&1

    Its just a hunch, but does this give the same error:
    echo test 0>&1

    See less
    • 0
  3. Try thisSub CreatePowerPoint() Dim mySlide As Object Dim SelectedSlide As Object Dim myShapeRange As PowerPoint.Shape Dim oPA As Object Dim oPP As PowerPoint.Presentation Dim strTemplate As String Dim rng As Range strTemplate = "C:\Users\290866\Desktop\vba\PPT\Template.potx" ' Set oPA = CreateObjectRead more

    Try this

    Sub CreatePowerPoint()
     
    Dim mySlide As Object
    Dim SelectedSlide As Object
    Dim myShapeRange As PowerPoint.Shape
    Dim oPA As Object
    Dim oPP As PowerPoint.Presentation
    Dim strTemplate As String
    Dim rng As Range
     
    strTemplate = "C:\Users\290866\Desktop\vba\PPT\Template.potx"
    '
    Set oPA = CreateObject("Powerpoint.application")
    oPA.Visible = True
    oPA.Presentations.Open strTemplate ', untitled:=msoTrue
    
    
    'If Not mySlide Is Nothing Then Set mySlide = Nothing
    'If Not oPP Is Nothing Then Set oPP = Nothing
    'If Not oPA Is Nothing Then Set oPA = Nothing
    
     
    Err_PPT:
    If Err <> 0 Then
    MsgBox Err.Description
    Err.Clear
    Resume Next
    End If
     
    Set rng = ThisWorkbook.Sheets("Sheet1").Range("B2:N59")
    Set mySlide = oPA.ActivePresentation.Slides(1)
    
     rng.Copy
        mySlide.Shapes.PasteSpecial (ppPasteBitmap)
      
      Set myShapeRange = mySlide.Shapes(mySlide.Shapes.Count)
    
    myShapeRange.LockAspectRatio = False
          myShapeRange.Left = 20
          myShapeRange.Top = 80
          myShapeRange.Height = 400
     myShapeRange.Width = 680
      Application.CutCopyMode = False
     
     
    End Sub

    See less

    • 0
  4. IT looks like outguess works on windows directly, why are you trying to run it through cygwin?without knowing anything else this error Segmentation fault (core dumped) seems to normally talk about a memory access violation, such as errors regarding pointers for virtual memory addressing. My guess isRead more

    IT looks like outguess works on windows directly, why are you trying to run it through cygwin?

    without knowing anything else this error Segmentation fault (core dumped) seems to normally talk about a memory access violation, such as errors regarding pointers for virtual memory addressing. My guess is that there is something that is causing your program to access something that it does not have access rights too.

    Have you considered attempting to r establish ownership through a chmod, or administrator rights using chown?

    ::mike

    message edited by mikelinus

    See less
    • 0
  5. since this has been sitting for a while, I noticed this page that was associated with the problem. perhaps this might be able to help.http://stackoverflow.com/questions/...:: mike

    since this has been sitting for a while, I noticed this page that was associated with the problem. perhaps this might be able to help.

    http://stackoverflow.com/questions/…

    :: mike

    See less
    • 0
  6. grep '[eééèĕê]nglish' file.txt should do the job.As mikelinus says, they are different characters so there's no easy way to just drop the accents (other than specifying each character).

    grep '[eééèĕê]nglish' file.txt

    should do the job.

    As mikelinus says, they are different characters so there’s no easy way to just drop the accents (other than specifying each character).

    See less
    • 0
  7. Yeh, at one point it occured to me it might be something to do with date format, but the line# (that got the error) threw me off the scent. (Seriously! I'm not just covering!) At any rate, vbscript has functions that might handle this, and also M2's approach, but that requires debug, and 64-bit machRead more

    Yeh, at one point it occured to me it might be something to do with date format, but the line# (that got the error) threw me off the scent. (Seriously! I’m not just covering!)
    At any rate, vbscript has functions that might handle this, and also M2’s approach, but that requires debug, and 64-bit machines don’t support debug. Try this snippet/test on your system and see if it gets it right:
    ‘==== begin vbscript datest
    z=date
    call test()
    wscript.echo “enter a test date: ”
    z=wscript.stdin.readline
    call test()
    sub test()
    wscript.echo z
    e=formatdatetime(z)
    wscript.echo e
    d=datepart(“d”,z)
    m=datepart(“m”,z)
    y=datepart(“yyyy”,z)
    wscript.echo “year:”,y,” “,right(“20″&y;,2)
    wscript.echo “month: “,m,” “,right(“0″&m;,2)
    wscript.echo “day: “,right(“0″&d;,2)
    ‘==== end vbscript
    Here’s my last posted vbscript amended to implement this. Hopefully it can handle regional settings since it accesses the system to get the settings:

    ‘===== begin vbscript “ep.vbs”
    set regx=new regexp
    regx.global=true
    ‘======== date decipher
    regx.pattern=”[^0-9]”
    ‘– get the delimiter
    dlm=regx.execute(date)(0)
    ‘– determine position of year element (leading or trailing)
    ye=datepart(“yyyy”,date)
    x=dateadd(“yyyy”,1,date)
    k=split(x,dlm)
    for i=0 to 2
    if k(i)-ye=1 then exit for
    next
    ‘– month and day position don’t matter since they’re both “1”
    base=”1″&dlm;&”1″
    if i=2 then base=base&dlm;&”1970″ else base=”1970″&dlm;&base;
    ‘—— end date-decipher, begin main body
    set fso=createobject(“scripting.filesystemobject”)
    infile=wscript.arguments(0)
    z=fso.opentextfile(infile,1).readall
    ‘this is to skip html files with no 10-digs
    on error resume next
    regx.pattern=”[^0-9][0-9]{10,10}[^0-9]”
    zz=mid(regx.execute(z)(0),2,10)/86400
    x=err.number
    err.clear
    if x=0 then
    nn=dateadd(“d”,zz,base)
    yy=right(“20″&datepart;(“yyyy”,nn),2)
    mm=right(“0″&datepart;(“m”,nn),2)
    a=yy&mm;
    wscript.echo “fso.movefile “+infile+”,”+wscript.arguments(2)+a+”_”+wscript.arguments(1)
    c=wscript.stdin.readline ‘testing
    if c=”r” then ‘testing
    fso.movefile infile,wscript.arguments(2)+a+”_”+wscript.arguments(1)
    end if ‘testing
    end if
    ‘===== end vbscript
    this one stops before each actual rename, and you can choose to skip (for testing), or execute the rename by entering “r”. Just hit ctrl-C to stop the run at any point. For production purposes, just remove the three lines around the movefile function.

    See less
    • 0
  8. Please test the following script. It's probably not very efficient, one of the forum gurus might drop in with some improvements.@echo off>%temp%\input.txt cls setlocal enabledelayedexpansion for /f "tokens=*" %%1 in (input.txt) do ( set inline=%%1& set inline=!inline:.=! if not "!inline:~0,3!Read more

    Please test the following script. It’s probably not very efficient, one of the forum gurus might drop in with some improvements.

    @echo off>%temp%\input.txt
    cls
    setlocal enabledelayedexpansion
    
    for /f "tokens=*" %%1 in (input.txt) do (
        set inline=%%1& set inline=!inline:.=!
        if not "!inline:~0,3!" equ "* *" (
        if not "!inline:~0,3!" equ "===" (
           echo !inline!>>%temp%\input.txt
        )
      )
    )
    
    @echo off>%temp%\input2.txt
    for /f "tokens=*" %%1 in (%temp%\input.txt%) do (
        set input=%%1
    
        for /f "tokens=2 delims=:" %%A in ("!input!") do (
            set ending=%%A
    
            if "!ending:~1,1!" equ "*" (
                echo !ending:~2!>>%temp%\input2.txt
                ) else (
                echo !ending!>>%temp%\input2.txt
          )
       )
    )
    
    @echo off>%temp%\input.txt
    for /f "tokens=1* delims=*" %%1 in (%temp%\input2.txt) do (
        set final=%%1
        if "!final:~0,1!" equ " " (
        set final=!final:~1!
        )
        echo !final!>>%temp%\input.txt
       
    )
    
    echo User name,User text,Begin menu,Group jobs,End group jobs,Command ^
    line on menus,Attention-key program,Reference user>newfile.csv
    
    for /f "tokens=*" %%1 in (%temp%\input.txt) do (
        set line=!line!%%1,
        set /a ctr +=1
        If !ctr! equ 8 (
           set line=!line:~0,-1!
           echo !line!>>newfile.csv
           set ctr=
           set line=
       )
    )
        
    :cleanup
    del %temp%\input*.txt
    

    Please come back & tell us if your problem is resolved.

    See less
    • 0