vbscript - Why is my source folder and destination folder merging names? I want source folder inside my destination -


dim wshnetwork,objnetwork, wshshell, objfso, objitem set objnetwork = createobject("wscript.network") set wshnetwork = wscript.createobject("wscript.shell") set objfso = createobject("scripting.filesystemobject") set wshshell = createobject("wscript.shell") if not objfso.folderexists("c:\backups")    objfso.createfolder "c:\backups" else end if if not objfso.folderexists("c:\backups\" & strusername)    objfso.createfolder ("c:\backups\" & strusername) else end if set fso = createobject("scripting.filesystemobject")  strusername = objnetwork.username set omainfolder = fso.getfolder("c:\users\" & strusername &"\documents\") each ofolder in omainfolder.subfolders    on error resume next    if ofolder.name <> "my music" , ofolder.name <> "my pictures" , ofolder.name <> "my videos"       fso.copyfolder ("c:\users\" & strusername &"\documents\") & ofolder.name, ("c:\backups\" & strusername) & ofolder.name, true          fso.copyfile ("c:\users\" & strusername &"\documents\*.*"), ("c:\backups\" & strusername), true    end if next 

because here

if not objfso.folderexists("c:\backups\" & strusername) 

the variable strusername not initialized/empty.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -