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
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
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?
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.
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.
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.
Forgotten Porn Blocker Password
Contact the software supplier.
Contact the software supplier.
See lessVbs Output To Csv Format
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 LoopSee lessThe System Cannot Write To The Specified Devi
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:
See lessecho test 0>&1
PowerPoint VBA Select Slide
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
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 SubOutguess Installed With CygWin Not Working
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
Is There Alternative To Continue In For-Loop In Forms 6i?
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
Ignore Diacritics And Accents In Grep
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).
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).
Batch Rename – Epoch Time To Human Time
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”
See lessset 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.
Batch File To Ping And Tracert An IP
tracert ibm.com > trace.log ping ibm.com > ping.log
tracert ibm.com > trace.log
See lessping ibm.com > ping.log
Batch File To Extract Context From Text File To Csv Format
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
@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*.txtPlease come back & tell us if your problem is resolved.