Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Create Folde with Strings

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,52055
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Create Folde with Strings
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Create Folde with Strings - 9/20/2007 3:32:51 AM   
  svansingel

 

Posts: 11
Score: 0
Joined: 9/18/2007
Status: offline
Ok here is the deal. I have this script that will create folders with Todays date.
That part works fine.
It will also create two subfolders.
What I need to do is. Copy files to the new Subfolders.
Below is what I use for creating the files

strFolderName = "C:\APACS\" & strCompName & "_" & strMonth & "-" & strDay & "-" & strYear
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.CreateFolder(strFolderName)
objFSO.CreateFolder(strFolderName) & "\PSLogs"
objFSO.CreateFolder(strFolderName) & "\APIlogs"
strPSLogsFolder = (strFolderName) & "\PSLogs"
strAPILogsFolder = (strFolderName) & "\APIlogs"


I used strPSLogsFolder as a string to represent the folder.
In this part, I need to copy files ot the folder

objFSO.CopyFile "\\" &strComputer &"\c$\Documents and Settings\" &strNewComp &"\Local Settings\Application Data\Dictaphone\HSG\Trace\PSClientApp\PSClientApp_LOG.txt" , strPSLogsFolder , OverwriteExisting 

any ideas?

Thanks
 
 
Post #: 1
 
 RE: Create Folde with Strings - 9/21/2007 2:55:13 AM   
  dm_4ever


Posts: 2726
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Have you tried using WScript.Echo to see what strPSLogsFolder is currently showing?  Perhaps there is an error in how you are building that string.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to svansingel)
 
 
Post #: 2
 
 RE: Create Folde with Strings - 9/21/2007 2:58:33 AM   
  svansingel

 

Posts: 11
Score: 0
Joined: 9/18/2007
Status: offline
Yes, I have the wscript.echo running and the correct path is there.

(in reply to dm_4ever)
 
 
Post #: 3
 
 RE: Create Folde with Strings - 9/21/2007 3:02:03 AM   
  dm_4ever


Posts: 2726
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Are you getting any errors?  Make sure you comment out "On Error Resume Next" if you are currently using it.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to svansingel)
 
 
Post #: 4
 
 RE: Create Folde with Strings - 9/21/2007 3:05:46 AM   
  svansingel

 

Posts: 11
Score: 0
Joined: 9/18/2007
Status: offline
Ok I rem out the On Error resume next.

Now I am getting:  Microsoft VBScript runtime error: Permission denied


not sure how I can fix that.

(in reply to dm_4ever)
 
 
Post #: 5
 
 RE: Create Folde with Strings - 9/21/2007 3:28:41 AM   
  dm_4ever


Posts: 2726
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Does your destination folder path contain a \ at the end?  If not...it should.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to svansingel)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Create Folde with Strings Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts