Create a folder on desktop via Vbscript -
i have 2 scripts not combine them
create folder script
option explicit dim objnetwork, objcomputer dim objfso, objfsotext, objfolder, objfile dim strdirectory, strfile, makeobject strdirectory = "folder" set objfso = createobject("scripting.filesystemobject") if objfso.folderexists(strdirectory) wscript.echo strdirectory & " exists" else 'below added line set objfolder = objfso.createfolder(strdirectory) wscript.echo "the folder " & strdirectory & " has been created" end if wscript.quit
desktop path script
set wshshell = wscript.createobject("wscript.shell") strdesktop = wshshell.specialfolders("desktop") wscript.echo(strdesktop)
con 1 me please ?
use .buildpath combine desktop folder path , intended (sub)folder(name):
>> set objfso = createobject("scripting.filesystemobject") >> set wshshell = wscript.createobject("wscript.shell") >> strdirectory = "folder" >> strdirectory = objfso.buildpath(wshshell.specialfolders("desktop"), strdirectory) >> wscript.echo strdirectory >> c:\documents , settings\eh\desktop\folder
Comments
Post a Comment