School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,137 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,819 people online right now. Registration is fast and FREE... Join Now!




What is this?

 

What is this?

ExplicitViper

17 Oct, 2009 - 03:05 AM
Post #1

New D.I.C Head
*

Joined: 8 Sep, 2008
Posts: 12



Thanked: 1 times
My Contributions
CODE
Function Get-WordDocuments
{
  "Counting pages in Word Docs in $folderPath"
$word = New-Object -ComObject word.application
$word.visible = $false
Get-ChildItem -path $folderpath -include $fileTypes |
foreach-object `
  {
   $path =  ($_.fullname).substring(0,($_.FullName).lastindexOf("."))
   $doc = $word.documents.open($_.fullname, $confirmConversion, $readOnly,
   $addToRecent,   $passwordD


i realized this isnt the entire code, but can someone tell me what this looks like it is going to do?

User is offlineProfile CardPM
+Quote Post


baavgai

RE: What Is This?

17 Oct, 2009 - 03:11 AM
Post #2

Dreaming Coder
Group Icon

Joined: 16 Oct, 2007
Posts: 4,351



Thanked: 412 times
Dream Kudos: 550
Expert In: C, C++, Java, C#, ASP.NET, PHP, Perl, Python, Oracle, SQL Server, MySql, HTML, JavaScript, Lua, Cheese

My Contributions
Looks like a Powershell script.

It makes an instance of MS Word. It then gets a list of files and opens them in word. Looks like there's a password. Can't really tell; globals.

User is offlineProfile CardPM
+Quote Post

ExplicitViper

RE: What Is This?

17 Oct, 2009 - 03:14 AM
Post #3

New D.I.C Head
*

Joined: 8 Sep, 2008
Posts: 12



Thanked: 1 times
My Contributions
so they could use this to steal passwords and important information?
User is offlineProfile CardPM
+Quote Post

Oler1s

RE: What Is This?

17 Oct, 2009 - 11:20 AM
Post #4

D.I.C Addict
****

Joined: 4 Jun, 2009
Posts: 734



Thanked: 69 times
My Contributions
QUOTE
so they could use this to steal passwords and important information?
This function, can open up password protected word documents. It seems that you need to provide the password to the script. It's made with a specific scenario in mind, not a "I'll steal all important information to you" kind of mentality. But you only gave us a small portion of the snippet, and so we can say nothing about the rest.

User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 03:10PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month