Search found 11150 matches

by jvierra
Wed Jun 30, 2010 2:17 am
Forum: Windows PowerShell
Topic: trying to match lines and assign to variable
Replies: 6
Views: 938

trying to match lines and assign to variable

crusader - yes that is a much easier way to state the collection of fields. I forgot about the PSObject constructor frm a hash.

Good call.

by jvierra
Wed Jun 30, 2010 1:57 am
Forum: Windows PowerShell
Topic: Formatting Issue
Replies: 26
Views: 3271

Formatting Issue

crusader - better but: This: select @{name="Server";Expression={$env:COMPUTERNAME}},Name,@{Name="Size (KB)";Expression={[Math]::Round($_.Length/1KB,2)}},@{Name="File Version";Expression={$_.VersionInfo | select -ExpandProperty FileVersion}},CreationTime,FullName is uneeded. This is shorter and faste...
by jvierra
Wed Jun 30, 2010 1:16 am
Forum: Windows PowerShell
Topic: Formatting Issue
Replies: 26
Views: 3271

Formatting Issue

YOu need to devide if you are filtering on file names or on extensions. You cannot easily do both. If you have a file of name: filename.dll filename2.exe ... Then just feed the file to 'dir' and it will do the rest. cat name.txt | %{dir $serverc$path -filter $_ -recurse}| ...next element The above w...
by jvierra
Tue Jun 29, 2010 11:53 pm
Forum: VBScript
Topic: VBscript Error
Replies: 6
Views: 1424

VBscript Error

Yes - it was an interesting excercise. Unfortunately what you learned was not about VBscript but about the WIndows Installer COM interfaces which are almost never used outside of an installer set.

Well, in any case we all learned a bit.

Good Luck
by jvierra
Tue Jun 29, 2010 9:04 pm
Forum: Windows PowerShell
Topic: Formatting Issue
Replies: 26
Views: 3271

Formatting Issue

NET use is not a good way as you will end up in a pickle.

If you are an admin use the admin shares.

$server="myserver"
dir $serverc$windowssystem32*.dll

The big proble, is how to drive this with two files at the same time. YOu are going to have to think very hard on this one.

by jvierra
Tue Jun 29, 2010 7:46 pm
Forum: Windows PowerShell
Topic: Formatting Issue
Replies: 26
Views: 3271

Formatting Issue

Try this:

"hello"|?{$true}

then try this:

"hello"|?{$false}

See what is happening.

It's a filter.
by jvierra
Tue Jun 29, 2010 7:30 pm
Forum: VBScript
Topic: VBscript Error
Replies: 6
Views: 1424

VBscript Error

Unfortunately there is very little writtenabout using the installer object to install packages. It is mostly used to manage packages. MSIEXEC is usually used directly to execute a package. In you case you can just run the MSI directly with no automation. Shell.Run "c:package.msi -qn" That would acco...
by jvierra
Tue Jun 29, 2010 7:19 pm
Forum: VBScript
Topic: Network login when launching script
Replies: 5
Views: 555

Network login when launching script

No - It's Windows. Ther eis no way to do that with script or with any other language. ALl logons and authorizations are done by teh operating system. YOU an use teh WMI code I posted and uuse InputBox to get teh username and password. That will let you list services and kill them with alternate cred...
by jvierra
Tue Jun 29, 2010 1:07 pm
Forum: VBScript
Topic: Network login when launching script
Replies: 5
Views: 555

Network login when launching script

Well you can do that but it's not what you originally asked for. Using RunAs is the easiest way to do that. YOu can create a shortcut the retains the credentials so you will not be prompted for them again after the first time. C:>RunAs /? RUNAS USAGE: RUNAS [ [/noprofile | /profile] [/env] [/netonly...
by jvierra
Tue Jun 29, 2010 12:19 pm
Forum: VBScript
Topic: Network login when launching script
Replies: 5
Views: 555

Network login when launching script

Let me rey another approach. YOu want the users to login but with what? You say - "to launch this script and be prompted for thier own network logon details". Why would you want a user to hand out their user credential arbitrarily? They are already logged into teh network with those credentials. You...