Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Help I need a VB script

Original Message
Name: zackuk
Date: January 22, 2008 at 00:23:16 Pacific
Subject: Help I need a VB script
OS: windows 2003
CPU/Ram: 2gb
Model/Manufacturer: dell
Comment:
Hi
I have got a script which gives me information in message boxes of users who have outlook archives file in their home directories.

the script is given below
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("\\dc.eurasp\EAD\PorthusHome")
Set fcf = f.SubFolders
For Each ff in fcf
If fso.FileExists(ff & "\outlook archives") Then
msgbox(ff)
End If
Next
Set fso = Nothing
1, I want some addition to this script so it can write the information in message boxes i.e the information of ff into a text file.

2. Using the above text file, I want the script to create a backup copy called outlook archives backup for all the users who have outlook archive file inside the same directory.

3. The last thing I want is the script to rename outlook archives file to outlook archives.pst

please help
many thanks



Report Offensive Message For Removal


Response Number 1
Name: Razor2.3
Date: January 22, 2008 at 00:42:44 Pacific
Subject: Help I need a VB script
Reply: (edit)
1) Do you want to get rid of the message boxes, or keep the pop ups?

2) Create a backup of what, where?


Report Offensive Follow Up For Removal

Response Number 2
Name: zackuk
Date: January 22, 2008 at 01:13:57 Pacific
Subject: Help I need a VB script
Reply: (edit)
I dont want the message boxes, all i want is the above 3 things
1. copy the information i.e. user names of users with outlook archives in a text file.

2. Using the user'ids from the above created text file, I want the outlook archives file to be copied and renamed to OUArchives in the same folder.

3, The last thing then I want is to rename all the outlook archives files for the users given in the text file to outlook archives.pst

many thanks again for your help


Report Offensive Follow Up For Removal

Response Number 3
Name: Razor2.3
Date: January 22, 2008 at 02:29:31 Pacific
Subject: Help I need a VB script
Reply: (edit)
2) What's this about the log file? Do you expect to make two passes, once to make the log file, then do a second pass and read the log file? What would be the point of that?

2) What's being renamed here, the copy we're making, or the original?

You know what? I don't care anymore. If this doesn't work for you, clarify your requirements.

Set fso = CreateObject("Scripting.FileSystemObject")
Set fOut = fso.OpenTextFile("log.txt", 8, True)
fOut.WriteLine "[SoS] " & Now
For Each ff In fso.GetFolder("\\dc.eurasp\EAD\PorthusHome").SubFolders
If fso.FileExists(ff & "\outlook archives") Then
With ff.Files("outlook archives")
fOut.WriteLine .Path
.Copy "outlook archives backup", True
.Name = "outlook archives.pst"
End With
End If
Next
fOut.WriteLine "[EoS]" & Now & vbNewLine


Report Offensive Follow Up For Removal

Response Number 4
Name: zackuk
Date: January 22, 2008 at 02:50:53 Pacific
Subject: Help I need a VB script
Reply: (edit)
Hi Razor
thanks for your reply,

This is the way it goes goes, I have a sample script as you have seen.

this sample script is good enough to show me user names of those users who have outlook archives file in their home directories which are located at \\dc.eurasp\EAD\PorthusHome.

I want 3 scripts

1. which logs information of users to a text file, the users who has got outlook archives
file inside a home directory.

2. I want the second script to look for usernames in the text file, for every single user name found inside the text file, I want the script to go to that users home directory and create a backup copy of outlook archives file with a different name inside the same directory.

3. Lastly I want the 3 script to rename all the old outlook archive files, of the users which are listed in the text file created in script 1

I hope I am clear, I really appreciate your help and god bless u for that
thanks



Report Offensive Follow Up For Removal

Response Number 5
Name: Razor2.3
Date: January 22, 2008 at 03:01:25 Pacific
Subject: Help I need a VB script
Reply: (edit)
Well, the script I posted does all three in one pass. If you need it broken up, let me know.

Report Offensive Follow Up For Removal


Response Number 6
Name: zackuk
Date: January 22, 2008 at 03:08:39 Pacific
Subject: Help I need a VB script
Reply: (edit)
RAzor,
I do need this to be broken in 3 parts,
once again I really appreciate your help.
thank you:)

Report Offensive Follow Up For Removal

Response Number 7
Name: Razor2.3
Date: January 22, 2008 at 03:40:18 Pacific
Subject: Help I need a VB script
Reply: (edit)
Untested, but I've more or less just spliced the working script apart.
Set fso = CreateObject("Scripting.FileSystemObject")
Set fOut = fso.OpenTextFile("log.txt", 2, True)
For Each ff In fso.GetFolder("\\dc.eurasp\EAD\PorthusHome").SubFolders
If fso.FileExists(ff & "\outlook archives") Then _
fOut.WriteLine ff & "\outlook archives"
Next

Set fso = CreateObject("Scripting.FileSystemObject")
Set fIn = fso.OpenTextFile("log.txt", 1)
Do Until fIn.AtEndOfStream
Set f = fso.GetFile(fIn.ReadLine)
f.Copy f.ParentFolder.Path & "\outlook archives backup", true
Loop

Set fso = CreateObject("Scripting.FileSystemObject")
Set fIn = fso.OpenTextFile("log.txt", 1)
Do Until fIn.AtEndOfStream
fso.GetFile(fIn.ReadLine).Name = "OUArchives"
Loop


Report Offensive Follow Up For Removal

Response Number 8
Name: zackuk
Date: January 22, 2008 at 05:41:48 Pacific
Subject: Help I need a VB script
Reply: (edit)
Many thanks for our help, but it gives error on all the three.
i am trying what ever i can to make it work
thanks again


Report Offensive Follow Up For Removal

Response Number 9
Name: zackuk
Date: January 22, 2008 at 06:26:41 Pacific
Subject: Help I need a VB script
Reply: (edit)
not working just i think minute compilation errors, i dont know if we could do the same thing using a batch file?

Report Offensive Follow Up For Removal

Response Number 10
Name: Razor2.3
Date: January 22, 2008 at 06:41:17 Pacific
Subject: Help I need a VB script
Reply: (edit)
Okay, I fixed #2 and #3 (bad copy/pasting), but if #1's throwing errors, you need to tell me what that error is, 'cause it works fine for me.

Report Offensive Follow Up For Removal

Response Number 11
Name: zackuk
Date: January 22, 2008 at 06:44:42 Pacific
Subject: Help I need a VB script
Reply: (edit)
not working just i think minute compilation errors, i dont know if we could do the same thing using a batch file?

Report Offensive Follow Up For Removal

Response Number 12
Name: zackuk
Date: January 22, 2008 at 06:50:19 Pacific
Subject: Help I need a VB script
Reply: (edit)
Hi Razor this is what it say s
Line 7
Char20
Error: expected statement
Code: 800A0400
Source: Microsoft VBScript Compilation error

thanks again


Report Offensive Follow Up For Removal

Response Number 13
Name: Razor2.3
Date: January 22, 2008 at 06:54:33 Pacific
Subject: Help I need a VB script
Reply: (edit)
not working just i think minute compilation errors
I'm pretty sure that isn't an error MS would give you, chief.

i dont know if we could do the same thing using a batch file?
Sure, I'm not about to, as there are plenty of Command Script experts here. But you'll find free help lacking if, "It just don't work," is your idea of feedback.


Report Offensive Follow Up For Removal

Response Number 14
Name: Razor2.3
Date: January 22, 2008 at 06:55:44 Pacific
Subject: Help I need a VB script
Reply: (edit)
Which script throws that error? And did you use the new versions?

Report Offensive Follow Up For Removal

Response Number 15
Name: zackuk
Date: January 22, 2008 at 07:26:50 Pacific
Subject: Help I need a VB script
Reply: (edit)
Razor
I am very sorry, if I come across rude I didnt mean to say anything to upset you, to be honest this is my first vb script which i am doing in my life, I always hated scripting and now i am stuck doing it. it was the first script which gave the error.




Report Offensive Follow Up For Removal

Response Number 16
Name: Razor2.3
Date: January 22, 2008 at 07:46:47 Pacific
Subject: Help I need a VB script
Reply: (edit)
Well, I don't know what to tell you; it runs fine on both my XP and Vista box. If it doesn't work, you probably would be better off with a command script. Like I said, I'm not going to do one; too many cooks in that kitchen. Instead, I think I'm going to bed.

Report Offensive Follow Up For Removal

Response Number 17
Name: zackuk
Date: January 23, 2008 at 04:38:50 Pacific
Subject: Help I need a VB script
Reply: (edit)
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("C:\users.txt")
Set f = fso.GetFolder("\\dc.eurasp\EADFS\PorthusHome")
Set fcf = f.SubFolders
For Each ff in fcf
If fso.FileExists(ff & "\outlook archives") Then oBjectfile.WriteLine ff

end if oBjectfile.WriteLine(i)

Set fso = Nothing
I hate SCRIPTING


Report Offensive Follow Up For Removal

Response Number 18
Name: zackuk
Date: January 23, 2008 at 05:15:17 Pacific
Subject: Help I need a VB script
Reply: (edit)
Razor thanks
I was making a mistake in the script which was cauisng problem, but your script is fine

many thanks for your help? by the way do you live in Fareast?


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Help I need a VB script

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




DSHUB24 Connection Problems

need help with dsl and dial up

novel 3.12

help mandriva install last straw!

Icon Scaling in Explorer Bar


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC