<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Novacreations &#187; Script</title>
	<atom:link href="http://www.novacreations.net/category/codigo/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.novacreations.net</link>
	<description>Desarollando Software</description>
	<lastBuildDate>Wed, 03 Mar 2010 17:52:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Crear Acceso Directo</title>
		<link>http://www.novacreations.net/250-crear-acceso-directo/</link>
		<comments>http://www.novacreations.net/250-crear-acceso-directo/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 00:34:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Código]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[WSH]]></category>

		<guid isPermaLink="false">http://www.novacreations.net/250-crear-acceso-directo/</guid>
		<description><![CDATA[El siguiente script permite crear un acceso directo en el escriotorio.
]]></description>
			<content:encoded><![CDATA[<p>El siguiente script permite crear un acceso directo en el escriotorio.</p>
<p><strong>desktop.vbs</strong></p>
<div class="igBar"><span id="lvb-1"><a href="#" onclick="javascript:showPlainTxt('vb-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-1">
<div class="vb">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> WSHShell, fs</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Set</span> WSHShell = WScript.<span style="color: #b1b100;">CreateObject</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"WScript.Shell"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Set</span> fs = WScript.<span style="color: #b1b100;">CreateObject</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Scripting.FileSystemObject"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Function</span> MakeDesktopShortcut<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color: #b1b100;">name</span>, target <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> Shortcut,DesktopPath,StartupPath</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DesktopPath = WSHShell.<span style="color: #66cc66;">SpecialFolders</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Desktop"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">Set</span> Shortcut = WSHShell.<span style="color: #66cc66;">CreateShortcut</span><span style="color:#006600; font-weight:bold;">&#40;</span>DesktopPath &amp; <span style="color: #ff0000;">"\"</span> &amp; <span style="color: #b1b100;">name</span> &amp; <span style="color: #ff0000;">".lnk"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Shortcut.<span style="color: #66cc66;">TargetPath</span> = target</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; StartupPath = fs.<span style="color: #66cc66;">GetParentFolderName</span><span style="color:#006600; font-weight:bold;">&#40;</span> target <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">If</span> fs.<span style="color: #66cc66;">FolderExists</span><span style="color:#006600; font-weight:bold;">&#40;</span> StartupPath <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #b1b100;">then</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Shortcut.<span style="color: #66cc66;">WorkingDirectory</span> = StartupPath</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Shortcut.<span style="color: #66cc66;">Save</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Function</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">MakeDesktopShortcut <span style="color: #ff0000;">"Shortcut to Calc"</span>,<span style="color: #ff0000;">"c:/windows/system32/calc.exe"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.novacreations.net/250-crear-acceso-directo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSH: Acceso Directo en el Menu Inicio</title>
		<link>http://www.novacreations.net/251-acceso-directo-en-el-menu-inicio/</link>
		<comments>http://www.novacreations.net/251-acceso-directo-en-el-menu-inicio/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 21:33:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Código]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[WSH]]></category>

		<guid isPermaLink="false">http://www.novacreations.net/251-acceso-directo-en-el-menu-inicio/</guid>
		<description><![CDATA[El siguiente Script te permite crear un Acceso Directo en tus entradas del menu de inicio. ]]></description>
			<content:encoded><![CDATA[<p>El siguiente Script te permite crear un Acceso Directo en tus entradas del menu de inicio. </p>
<p><strong>startmenu.vbs</strong></p>
<div class="igBar"><span id="lvb-2"><a href="#" onclick="javascript:showPlainTxt('vb-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-2">
<div class="vb">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Set</span> objNetwork = <span style="color: #b1b100;">CreateObject</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Wscript.Network"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">strUser = objNetwork.<span style="color: #66cc66;">UserName</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">strPath = <span style="color: #ff0000;">"C:\Documents and Settings\"</span> &amp; strUser</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Set</span> objShell = <span style="color: #b1b100;">CreateObject</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Wscript.Shell"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">strPrograms = objShell.<span style="color: #66cc66;">SpecialFolders</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Programs"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Set</span> objShellLink = objShell.<span style="color: #66cc66;">CreateShortcut</span><span style="color:#006600; font-weight:bold;">&#40;</span>strPrograms &amp; <span style="color: #ff0000;">"\"</span> &amp; strUser &amp; <span style="color: #ff0000;">".lnk"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">objShellLink.<span style="color: #66cc66;">TargetPath</span> = <span style="color: #ff0000;">"c:/windows/system32/calc.exe"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">objShellLink.<span style="color: #66cc66;">Description</span> = <span style="color: #ff0000;">"Calculadora de "</span> &amp; strUser</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">objShellLink.<span style="color: #66cc66;">WorkingDirectory</span> = strPath</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">objShellLink.<span style="color: #66cc66;">Save</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.novacreations.net/251-acceso-directo-en-el-menu-inicio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSH: FileInfo Script</title>
		<link>http://www.novacreations.net/252-fileinfo-script/</link>
		<comments>http://www.novacreations.net/252-fileinfo-script/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 20:56:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Código]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[WSH]]></category>

		<guid isPermaLink="false">http://www.novacreations.net/252-fileinfo-script/</guid>
		<description><![CDATA[Este Script te permite buscar un archivo y te muestra sus detalles. Es un buen ejemplo ya que te ayuda a empezar a usar algunas funciones de manipulación de archivos, ventanas y ciclos.]]></description>
			<content:encoded><![CDATA[<p>Este Script te permite buscar un archivo y te muestra sus detalles. Es un buen ejemplo ya que te ayuda a empezar a usar algunas funciones de manipulación de archivos, ventanas y ciclos.</p>
<p><strong>FileInfo.vbs</strong></p>
<div class="igBar"><span id="lvb-3"><a href="#" onclick="javascript:showPlainTxt('vb-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-3">
<div class="vb">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' FileInfo.vbs&nbsp; Quickly search your drive for specified file name and return</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' path, version, size and date information.&nbsp; Can search a specified drive, or</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' or all drives.&nbsp; Use only the file name, not the extension.&nbsp; Requires WMI,</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' which is included with Windows 2000 and Windows XP.&nbsp; For Windows 95, 98, ME</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' and NT4, WMI can be downloaded at</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' http://msdn.microsoft.com/downloads/sdks/wmi/download.asp</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' © Bill James - wgjames@mvps.org - Released 14 Nov 2002 - Revised 16 Nov 2002</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Option</span> <span style="color: #b1b100;">Explicit</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> fso, OutFile, sDrv, sFName, sReport, sFile, sTitle</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sTitle = <span style="color: #ff0000;">"FileInfo.vbs © Bill James"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Set</span> fso = <span style="color: #b1b100;">CreateObject</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Scripting.FileSystemObject"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">OutFile = <span style="color: #ff0000;">"C:\searched.txt"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">If</span> fso.<span style="color: #66cc66;">FileExists</span><span style="color:#006600; font-weight:bold;">&#40;</span>OutFile<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #b1b100;">Then</span> fso.<span style="color: #66cc66;">DeleteFile</span><span style="color:#006600; font-weight:bold;">&#40;</span>OutFile<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Set</span> sReport = fso.<span style="color: #66cc66;">OpenTextFile</span><span style="color:#006600; font-weight:bold;">&#40;</span>OutFile, <span style="color: #cc66cc;color:#800000;">8</span>, <span style="color: #b1b100;">True</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sDrv = <span style="color: #b1b100;">InputBox</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Enter drive letter to search (letter only)"</span> &amp; <span style="color: #b1b100;">vbcrlf</span> &amp; _</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">vbcrlf</span> &amp; <span style="color: #ff0000;">"(Enter * to search all local drive letters)"</span>, sTitle<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">If</span> sDrv = <span style="color: #ff0000;">""</span> <span style="color: #b1b100;">Then</span> WScript.<span style="color: #66cc66;">Quit</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sFName = <span style="color: #b1b100;">InputBox</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Enter file name to search for (no extension)"</span>, sTitle<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">If</span> sFName = <span style="color: #ff0000;">""</span> <span style="color: #b1b100;">Then</span> WScript.<span style="color: #66cc66;">Quit</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">GetResults <span style="color: #ff0000;">"c:"</span>, sFName</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sReport.<span style="color: #b1b100;">Close</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Set</span> sReport = <span style="color: #b1b100;">Nothing</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Dim</span> f, ra, Results</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Set</span> f = fso.<span style="color: #66cc66;">OpenTextFile</span><span style="color:#006600; font-weight:bold;">&#40;</span>OutFile<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">On</span> <span style="color: #b1b100;">Error</span> <span style="color: #b1b100;">Resume</span> <span style="color: #b1b100;">Next</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ra =&nbsp; f.<span style="color: #66cc66;">ReadAll</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">If</span> <span style="color: #b1b100;">Err</span> <span style="color: #b1b100;">Then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; Results = <span style="color: #cc66cc;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">On</span> <span style="color: #b1b100;">Error</span> <span style="color: #b1b100;">GoTo</span> <span style="color: #cc66cc;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">f.<span style="color: #b1b100;">Close</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Set</span> f = <span style="color: #b1b100;">Nothing</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Set</span> fso = <span style="color: #b1b100;">Nothing</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">If</span> Results&gt; <span style="color: #cc66cc;color:#800000;">0</span> <span style="color: #b1b100;">Then</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; Wscript.<span style="color: #b1b100;">CreateObject</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"WScript.Shell"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Run</span> OutFile</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #b1b100;">MsgBox</span> <span style="color: #ff0000;">"No matches found for "</span> &amp; <span style="color: #b1b100;">chr</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">34</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp; sFName &amp; <span style="color: #b1b100;">chr</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">34</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #ff0000;">" on "</span> &amp; sDrv,, sTitle</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Sub</span> GetResults<span style="color:#006600; font-weight:bold;">&#40;</span>drv, fname<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #b1b100;">Dim</span> sWQL, oFile, sAttrib</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; sWQL = <span style="color: #ff0000;">"select * from cim_datafile where Drive='"</span> &amp; _</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drv &amp; <span style="color: #ff0000;">"' AND FileName = '"</span> &amp; fname &amp; <span style="color: #ff0000;">"'"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #b1b100;">For</span> Each oFile In <span style="color: #b1b100;">GetObject</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"winmgmts:"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">execquery</span><span style="color:#006600; font-weight:bold;">&#40;</span>sWQL<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Results = Results + <span style="color: #cc66cc;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; sFile = oFile.<span style="color: #b1b100;">Name</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">Set</span> f = fso.<span style="color: #66cc66;">GetFile</span><span style="color:#006600; font-weight:bold;">&#40;</span>sFile<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; sReport.<span style="color: #66cc66;">WriteLine</span> sFile &amp; <span style="color: #b1b100;">vbcrlf</span> &amp; <span style="color: #ff0000;">"Version: "</span> &amp; _</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; fso.<span style="color: #66cc66;">GetFileVersion</span><span style="color:#006600; font-weight:bold;">&#40;</span>sFile<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">vbcrlf</span> &amp; <span style="color: #ff0000;">"Created: "</span> &amp; _</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; f.<span style="color: #66cc66;">DateCreated</span> &amp; <span style="color: #b1b100;">vbcrlf</span> &amp; <span style="color: #ff0000;">"Modified: "</span> &amp; f.<span style="color: #66cc66;">DateLastModified</span> &amp; _</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">vbcrlf</span> &amp; <span style="color: #ff0000;">"Size: "</span> &amp; FormatNumber<span style="color:#006600; font-weight:bold;">&#40;</span>f.<span style="color: #66cc66;">Size</span>, <span style="color: #cc66cc;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #ff0000;">" bytes"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">If</span> oFile.<span style="color: #66cc66;">Archive</span> <span style="color: #b1b100;">Then</span> sAttrib = <span style="color: #ff0000;">"Archive "</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">If</span> oFile.<span style="color: #66cc66;">Compressed</span> <span style="color: #b1b100;">Then</span> sAttrib = sAttrib &amp; <span style="color: #ff0000;">"Compressed "</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">If</span> oFile.<span style="color: #66cc66;">Encrypted</span> <span style="color: #b1b100;">Then</span> sAttrib = sAttrib &amp; <span style="color: #ff0000;">"Encrypted "</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">If</span> oFile.<span style="color: #66cc66;">Hidden</span> <span style="color: #b1b100;">Then</span> sAttrib = sAttrib &amp; <span style="color: #ff0000;">"Hidden "</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">If</span> oFile.<span style="color: #66cc66;">System</span> <span style="color: #b1b100;">Then</span> sAttrib = sAttrib &amp; <span style="color: #ff0000;">"System "</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">If</span> <span style="color: #b1b100;">NOT</span> oFile.<span style="color: #66cc66;">Writeable</span> <span style="color: #b1b100;">Then</span> sAttrib = sAttrib &amp; <span style="color: #ff0000;">"ReadOnly "</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">If</span> sAttrib &lt;&gt; <span style="color: #ff0000;">""</span> <span style="color: #b1b100;">Then</span> sReport.<span style="color: #66cc66;">WriteLine</span> <span style="color: #ff0000;">"Attributes: "</span> &amp; sAttrib &amp; <span style="color: #b1b100;">vbcrlf</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; sAttrib = <span style="color: #ff0000;">""</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #b1b100;">Next</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' Revisions</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">'&nbsp; &nbsp;15 Nov 2002 - Added MsgBox if no search matches found.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">'&nbsp; &nbsp;16 Nov 2002 - Added file attributes to the report </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.novacreations.net/252-fileinfo-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSH: Crear una entrada ODBC para SQL Server</title>
		<link>http://www.novacreations.net/253-wsh-crear-una-entrada-odbc-para-sql-server/</link>
		<comments>http://www.novacreations.net/253-wsh-crear-una-entrada-odbc-para-sql-server/#comments</comments>
		<pubDate>Mon, 05 Nov 2007 18:57:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Código]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[WSH]]></category>

		<guid isPermaLink="false">http://www.novacreations.net/253-wsh-crear-una-entrada-odbc-para-sql-server/</guid>
		<description><![CDATA[Este script automatiza la creación de una entra ODBC para conectarse a un servidor SQL Server.
]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.novacreations.net/wp-content/uploads/2007/11/odbc.JPG' alt='odbc.JPG'  align='left' hspace="15" vspace="15"/>Este script automatiza la creación de una entra ODBC para conectarse a un servidor SQL Server.</p>
<p><strong>CreateDSN.vbs</strong></p>
<div class="igBar"><span id="lvb-4"><a href="#" onclick="javascript:showPlainTxt('vb-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Visual Basic:</span>
<div id="vb-4">
<div class="vb">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">'===================</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' File: CreateDSN.vbs</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' AUTHOR: Dixan Martinez</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' Date : 2/2/2000</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">' COMMENT: </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">'===================</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> DataSourceName</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> DatabaseName</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> Description</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> DriverPath</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> DriverName</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> LastUser</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> Regional</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> Server</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Const</span> SystemFolder= <span style="color: #cc66cc;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> fso</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> SysFolder</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> SysFolderPath</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Set</span> fso = wscript.<span style="color: #b1b100;">CreateObject</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Scripting.FileSystemObject"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Set</span> SysFolder =fso.<span style="color: #66cc66;">GetSpecialFolder</span><span style="color:#006600; font-weight:bold;">&#40;</span>SystemFolder<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;SysFolderPath= SysFolder.<span style="color: #66cc66;">Path</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">Set</span> oArg= wscript.<span style="color: #66cc66;">Arguments</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">if</span> oArg.<span style="color: #b1b100;">Count</span> &lt;&gt; <span style="color: #cc66cc;color:#800000;">4</span> <span style="color: #b1b100;">then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">call</span> Usage</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #b1b100;">end</span> <span style="color: #b1b100;">if</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #808080;">'Specify the DSN parameters.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;DataSourceName = oArg<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;DatabaseName = oArg<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;Description = <span style="color: #ff0000;">"Odbc de BD"</span> &amp; DatabaseName</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;DriverPath = SysFolderPath &amp; <span style="color: #ff0000;">"\sqlsrv32.dll"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;Server = oArg<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;LastUser&nbsp; = oArg<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;DriverName = <span style="color: #ff0000;">"SQL Server"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #808080;">'Creamos objetos que escriben en el registro</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Set</span> WshShell = WScript.<span style="color: #b1b100;">CreateObject</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"WScript.Shell"</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080;">'Establecemos el Key del DSn en el registro</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> RegEdPath</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; RegEdPath= <span style="color: #ff0000;">"HKLM\SOFTWARE\ODBC\ODBC.INI\"</span> &amp; DataSourceName &amp; <span style="color: #ff0000;">"\"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080;">'Grabamos</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; WshShell.<span style="color: #66cc66;">RegWrite</span>&nbsp; RegEdPath&nbsp; , <span style="color: #ff0000;">""</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #808080;">'Ponemos los valores de la nueva Key correspondiente al DSN</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;WshShell.<span style="color: #66cc66;">RegWrite</span>&nbsp; RegEdPath &amp; <span style="color: #ff0000;">"Database"</span> , DatabaseName</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;WshShell.<span style="color: #66cc66;">RegWrite</span>&nbsp; RegEdPath &amp; <span style="color: #ff0000;">"Description"</span> , Description</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;WshShell.<span style="color: #66cc66;">RegWrite</span>&nbsp; RegEdPath &amp; <span style="color: #ff0000;">"Driver"</span> , DriverPath</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;WshShell.<span style="color: #66cc66;">RegWrite</span>&nbsp; RegEdPath &amp; <span style="color: #ff0000;">"LastUser"</span> , LastUser</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;WshShell.<span style="color: #66cc66;">RegWrite</span>&nbsp; RegEdPath &amp; <span style="color: #ff0000;">"Server"</span> , Server</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #808080;">'Escribo en el Key &quot;ODBC Data Sources&quot; para poder listar el nuevo DSN</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #808080;">' en el ODBC Manager</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;WshShell.<span style="color: #66cc66;">RegWrite</span> <span style="color: #ff0000;">"HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\"</span> &amp; DataSourceName , DriverName</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">wscript.<span style="color: #66cc66;">Quit</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080;">'--------------------</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">Sub</span> Usage</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;wscript.<span style="color: #66cc66;">echo</span> <span style="color: #ff0000;">"Create a DSN to access a SQL Server database with ODBC"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;wscript.<span style="color: #66cc66;">echo</span> <span style="color: #ff0000;">"Uso :"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;wscript.<span style="color: #66cc66;">echo</span> <span style="color: #ff0000;">"CreateDSN.vbs &lt;DSNName&gt; &lt;DataBaseName&gt; &lt;SQLServer&gt; &lt;User&gt; "</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;wscript.<span style="color: #66cc66;">echo</span> <span style="color: #ff0000;">""</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;wscript.<span style="color: #66cc66;">echo</span> <span style="color: #ff0000;">"Ejemplo 1 : CreaDSN.vbs NuevoDSN Pub MySQLServer AdminUser"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;wscript.<span style="color: #66cc66;">Quit</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">end</span> <span style="color: #b1b100;">sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.novacreations.net/253-wsh-crear-una-entrada-odbc-para-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
