﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>renew IP address in login script</title><link>http://www.visualbasicscript.com/</link><description /><copyright>(c) VBScript Forum</copyright><ttl>30</ttl><item><title> RE: renew IP address in login script (kracksmith)</title><description>  digital skeam &lt;br&gt;  &amp;nbsp; &lt;br&gt;  I just went through your script. I can't use a .bat file for login. My current login script is in .vbs &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  do you have a markfile script in VBS? &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25661</link><pubDate>Wed, 07 Sep 2005 23:10:49 GMT</pubDate></item><item><title> RE: renew IP address in login script (kracksmith)</title><description>  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;Ok, thanks for everyone’s input. Everything is perfect and I can sleep better now.&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;I found out that my 1&lt;/font&gt;&lt;font size="3"&gt;st&lt;/font&gt;&lt;font size="3"&gt; final script does work over the network. It just the .bat file doesn’t work over the network drive mappings when testing but does work over the network itself. &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;Both of these works if anyone needs it. &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;Script 1: &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;Set network = WScript.CreateObject("WScript.Network") &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;Set fso = WScript.CreateObject("Scripting.FileSystemObject") &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;Set WshShell = Wscript.CreateObject("Wscript.Shell") &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;fso.CopyFile "\\Prod2\N_Drive\Public\Prod2 Print Scripts\rapid.bat", "C:\" &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;WshShell.run "cmd /c c:\rapid.bat",0,True &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;WScript.Sleep 100000 &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;fso.DeleteFile "c:\rapid.bat"&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;Script 2:&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;Copy.vbs &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;Set network = WScript.CreateObject("WScript.Network") &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;Set fso = WScript.CreateObject("Scripting.FileSystemObject") &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;Set WshShell = Wscript.CreateObject("Wscript.Shell") &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;fso.CopyFile "\\Prod2\N_Drive\Public\Prod2 Print Scripts\rapid.bat", "C:\"&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;fso.CopyFile "\\Prod2\N_Drive\Public\Prod2 Print Scripts\ip_renew.vbs", "C:\"&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;WshShell.Run "C:\ip_renew.vbs"&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;Ip_renew.vbs&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;Set WshShell = Wscript.CreateObject("Wscript.Shell")&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;Set fso = WScript.CreateObject("Scripting.FileSystemObject")&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;WshShell.run "cmd /c c:\rapid.bat",0,True &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;WScript.Sleep 100000 &lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;fso.DeleteFile "c:\rapid.bat"&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;fso.DeleteFile "c:\ip_renew.vbs"&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;rapid.bat&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;ipconfig /flushdns&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;gpupdate /force&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;ipconfig /release&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font size="3"&gt;&lt;font face="times new roman"&gt;ipconfig /renew&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;exit&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;font face="times new roman"&gt;&lt;font size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt; &lt;br&gt;  &lt;a href="http://www.visualbasicscript.com/showProfile.aspx?memid=8013" target="_blank" rel="nofollow"&gt;&lt;font size="2"&gt;DiGiTAL.SkReAM&lt;/font&gt;&lt;/a&gt; when I do a IPCONFIG /RELEASE &amp;amp; /RENEW i don’t need to restart my computer. I do need this statement because we configured DHCP to another server. So basically I need to release and renew every workstation otherwise all workstations IP will expire within a week.  &lt;br&gt;  &lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt; &lt;br&gt;  Thanks for your input regarding markers. I need to implement it another time as I don’t have time to mess around with this script any more. For now hopefully everyone can logoff and log back on within 2 days. Then I’ll just take it off the login group policy. </description><link>http://www.visualbasicscript.com/fb.ashx?m=25640</link><pubDate>Wed, 07 Sep 2005 13:57:52 GMT</pubDate></item><item><title> RE: renew IP address in login script (DiGiTAL.SkReAM)</title><description>  Do you really need to have a ipconfig/renew statement?&amp;nbsp; Correct me if I am wrong, but if you do a ipconfig/release, and then reboot the workstation, will it not reach for a new IP via DHCP&amp;nbsp;when it comes back on? &lt;br&gt;  If you are running the scripts on Windows Xp Pro boxen, you shoudl be able to just do this: &lt;br&gt;  &amp;nbsp;(Lines in your login.bat) &lt;br&gt;  &lt;font color="#3333cc"&gt;if not exist c:\IPChangeDone.Markfile xcopy &lt;/font&gt;&lt;font color="#3333cc"&gt;\\server\share\rapid.cmd&lt;/font&gt;&lt;font color="#3333cc"&gt; c:\ /y&lt;/font&gt; &lt;br&gt;  &lt;font color="#3333cc"&gt;if exist c:\rapid.bat start %comspec% /c c:\rapid.cmd&lt;/font&gt; &lt;br&gt;  &lt;font color="#3333cc"&gt;:EOF&lt;/font&gt; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Then, your rapid.cmd file should contain: &lt;br&gt;  &lt;font color="#3333cc"&gt;ipconfig/release&lt;/font&gt; &lt;br&gt;  &lt;font color="#3333cc"&gt;echo. &amp;gt; c:\IPChangeDone.Markfile&lt;/font&gt; &lt;br&gt;  &lt;font color="#3333cc"&gt;shutdown -r -t 10 -c "Workstation rebooting to facilitate network maintenance.&amp;nbsp; Please Stand By" -f&lt;/font&gt; &lt;br&gt;  &lt;font color="#3333cc"&gt;:EOF&lt;/font&gt; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  You would call the rapid.bat file from the login.bat as the very last thing that you do because as soona s you do, the network conenction would be lost. &lt;br&gt;  As you can see from above, the order of events is: &lt;br&gt;  1.) If the log file is not present, it means that the job has not run, so go ahead nad copy rapid.bat over to C:\ &lt;br&gt;  2.) if the rapid.bat file is present, run it. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Conversely, if you would rather just do everything from one line in your login.bat, without having to reboot, or run external files, etc... you can use this command as the last one in your login.bat file: &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &lt;font color="#3333cc"&gt;if not exist c:\IPChangeDone.Markfile ipconfig/release&amp;amp;&amp;amp;ipconfig/renew&amp;amp;&amp;amp;echo. &amp;gt; c:\IPChangeDone.Markfile&amp;amp;&amp;amp;shutdown -r -t&amp;nbsp;5 -f&lt;/font&gt; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  That way, if it doesn't find the mark file, it will release and renew the IP address, create the mark file, and then reboot the workstationw ith a&amp;nbsp;five second delay. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Hope this helps. &lt;br&gt;  &amp;nbsp; &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25625</link><pubDate>Wed, 07 Sep 2005 07:24:01 GMT</pubDate></item><item><title> RE: renew IP address in login script (thantos_kalev2001)</title><description>  Yes, that will work.&amp;nbsp; Just make sure that you have that .vbs file in the C directory!&amp;nbsp;  &lt;br&gt;  :) &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Thantos &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25622</link><pubDate>Wed, 07 Sep 2005 06:18:24 GMT</pubDate></item><item><title> RE: renew IP address in login script (kracksmith)</title><description>  Would this be the correct verbage which I'll put in my 1st script called "copy.vbs"? &lt;br&gt;  &amp;nbsp; &lt;br&gt;  I want my 1st script called "copy.vbs" to run another script called "ip_renew.vbs" &lt;br&gt;  &amp;nbsp; &lt;br&gt;  then this ip_renew.vbs will run the rapid.bat &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  objShell.Run "C:\ip_renew.vbs" &lt;br&gt;  &amp;nbsp; &lt;br&gt;   &lt;br&gt;  &amp;nbsp; &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25602</link><pubDate>Tue, 06 Sep 2005 17:01:56 GMT</pubDate></item><item><title> RE: renew IP address in login script (kracksmith)</title><description>  gpupdate /force works here.  &lt;br&gt;  &amp;nbsp; &lt;br&gt;  if it doesn't in the future I'll use gpupdate. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  my script still doesn't work as I need my 1st script to call or run my 2nd script. I don't have the verbage for this.  &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  how do I run my 1st script then ask this 1st script to run another script? &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25589</link><pubDate>Tue, 06 Sep 2005 09:06:18 GMT</pubDate></item><item><title> RE: renew IP address in login script (thantos_kalev2001)</title><description>  Have you tested your 2 script method?&amp;nbsp; This looks like it should work. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  One caveat:&amp;nbsp; My script stalls when I run the gpupdate/force command--I am prompted on whether or not I want to reboot, and it hangs my script.&amp;nbsp; Maybe this is causing the problem with yours?&amp;nbsp;&amp;nbsp; You might want to just use &lt;b&gt;gpupdate&lt;/b&gt; rather than &lt;b&gt;gpupdate/force&lt;/b&gt; . &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Thantos &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25581</link><pubDate>Tue, 06 Sep 2005 08:03:43 GMT</pubDate></item><item><title> RE: renew IP address in login script (kracksmith)</title><description>  Sorry guys.  &lt;br&gt;   &lt;br&gt;  This script doesn't run from the network. So if its is ran in the login script then it won't work. testing it locally works but there's no point. &lt;br&gt;   &lt;br&gt;  everything works until it runs the "rapid.bat" which release the ip address and Bam! no connection. So basically I had to goto that workstation and "ipconfig renew".  &lt;br&gt;   &lt;br&gt;   &lt;br&gt;   &lt;br&gt;  I believe I need 2 vbs script. &lt;br&gt;   &lt;br&gt;   &lt;br&gt;  1st script is&amp;nbsp;to copy 2 files from network to local C drive (ip_renew.vbs &amp;amp; rapid.bat)&amp;nbsp;&amp;nbsp; &amp;amp; we can name this 1st script = copy.vbs &lt;br&gt;   &lt;br&gt;  then in this copy.vbs script to run ip_renew.vbs &lt;br&gt;   &lt;br&gt;  ip_renew.vbs is&amp;nbsp;a local script in C drive&amp;nbsp;should run the rapid.bat, &amp;nbsp;wait awhile then delete 2 files in the C drive (ip_renew.vbs &amp;amp; rapid.bat) &lt;br&gt;   &lt;br&gt;   &lt;br&gt;  This is what I have so far &lt;br&gt;   &lt;br&gt;   &lt;br&gt;  copy.vbs: &lt;br&gt;   &lt;br&gt;  Set network = WScript.CreateObject("WScript.Network")  &lt;br&gt;  Set fso = WScript.CreateObject("Scripting.FileSystemObject")  &lt;br&gt;  Set WshShell = Wscript.CreateObject("Wscript.Shell")  &lt;br&gt;  fso.CopyFile "\\Prod2\N_Drive\Public\Prod2 Print Scripts\rapid.bat", "C:\"  &lt;br&gt;  fso.CopyFile "\\Prod2\N_Drive\Public\Prod2 Print Scripts\ip_renew.vbs", "C:\" &lt;br&gt;   &lt;br&gt;  (need the verbage to run the ip_renew.vbs in local C drive after the copying) &lt;br&gt;   &lt;br&gt;   &lt;br&gt;   &lt;br&gt;  ip_renew.vbs: &lt;br&gt;   &lt;br&gt;  Set network = WScript.CreateObject("WScript.Network") &lt;br&gt;  Set WshShell = Wscript.CreateObject("Wscript.Shell") &lt;br&gt;  WshShell.run "cmd /c c:\rapid.bat",0,True  &lt;br&gt;  WScript.Sleep 100000  &lt;br&gt;  fso.DeleteFile "c:\rapid.bat", "c:\ip_renew.vbs" &lt;br&gt;   &lt;br&gt;   &lt;br&gt;   &lt;br&gt;  rapid.bat:  &lt;br&gt;   &lt;br&gt;  ipconfig /flushdns  &lt;br&gt;  gpupdate /force  &lt;br&gt;  ipconfig /release  &lt;br&gt;  ipconfig /renew  &lt;br&gt;  exit  &lt;br&gt;   &lt;br&gt;   &lt;br&gt;   &lt;br&gt;  or is there a easier way doing it with 1 script? I can't image there is since ipconfig /release will disconnect everything </description><link>http://www.visualbasicscript.com/fb.ashx?m=25515</link><pubDate>Fri, 02 Sep 2005 15:14:39 GMT</pubDate></item><item><title> RE: renew IP address in login script (kracksmith)</title><description>  i took country 73 suggestion which runs everything trully in the background &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Here is my final script revised: &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Set network = WScript.CreateObject("WScript.Network")  &lt;br&gt;  Set fso = WScript.CreateObject("Scripting.FileSystemObject")  &lt;br&gt;  Set WshShell = Wscript.CreateObject("Wscript.Shell")  &lt;br&gt;  fso.CopyFile "\\Prod2\N_Drive\Public\Prod2 Print Scripts\rapid.bat", "C:\"  &lt;br&gt;  WshShell.run "cmd /c c:\rapid.bat",0,True  &lt;br&gt;  WScript.Sleep 100000  &lt;br&gt;  fso.DeleteFile "c:\rapid.bat" &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  my rapid.bat  &lt;br&gt;   &lt;br&gt;  ipconfig /flushdns  &lt;br&gt;  gpupdate /force  &lt;br&gt;  ipconfig /release  &lt;br&gt;  ipconfig /renew  &lt;br&gt;  exit  &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25514</link><pubDate>Fri, 02 Sep 2005 14:08:48 GMT</pubDate></item><item><title> RE: renew IP address in login script (kracksmith)</title><description>  ok, thanks to everyone! &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  here is my final working script: &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Set network = WScript.CreateObject("WScript.Network")  &lt;br&gt;  Set fso = WScript.CreateObject("Scripting.FileSystemObject")  &lt;br&gt;  Set WshShell = Wscript.CreateObject("Wscript.Shell")  &lt;br&gt;  'WScript.Echo "Click OK to release &amp;amp; renew your IP address"  &lt;br&gt;  fso.CopyFile "\\Prod2\N_Drive\Public\Prod2 Print Scripts\rapid.bat", "C:\"  &lt;br&gt;  WshShell.run("%comspec% /k c:\rapid.bat")  &lt;br&gt;  WScript.Sleep 100000  &lt;br&gt;  fso.DeleteFile "c:\rapid.bat"  &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  my rapid.bat &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  ipconfig /flushdns &lt;br&gt;  gpupdate /force &lt;br&gt;  ipconfig /release &lt;br&gt;  ipconfig /renew &lt;br&gt;  exit &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25511</link><pubDate>Fri, 02 Sep 2005 10:36:15 GMT</pubDate></item><item><title> RE: renew IP address in login script (Country73)</title><description>  You should also be able to use: &lt;br&gt;   &lt;br&gt;  WshShell.run "cmd /c c:\test\batfileName.bat",0,True &lt;br&gt;  fso.DeleteFile "c:\test\batfileName.bat" &lt;br&gt;   &lt;br&gt;  Running it this way will hide the command window, wait for the batch file to complete before going to the next step. (which is deleteing the bat file) &lt;br&gt;  That way you don't run into some machines "hanging" and the script trying to delete the bat file before completion.  &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25510</link><pubDate>Fri, 02 Sep 2005 09:56:36 GMT</pubDate></item><item><title> RE: renew IP address in login script (kracksmith)</title><description>  i don't think my scripts likes the "WshShell" &lt;br&gt;  &amp;nbsp; &lt;br&gt;  do i need to create an object for this or anything? &lt;br&gt;  &amp;nbsp; &lt;br&gt;  would this script just reconize "WshShell"? &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25509</link><pubDate>Fri, 02 Sep 2005 09:56:34 GMT</pubDate></item><item><title> RE: renew IP address in login script (thantos_kalev2001)</title><description>  Mbouchard is right about the comspec...I am running windows Xp, but you might have a different path to the command line.&amp;nbsp; Replacing %comspec% with cmd should work as well...I just used what works for me. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Sorry for the confusion! &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Thantos &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25507</link><pubDate>Fri, 02 Sep 2005 09:50:40 GMT</pubDate></item><item><title> RE: renew IP address in login script (thantos_kalev2001)</title><description>  Here is what I used to get it to work: &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &lt;b&gt;Set network = WScript.CreateObject("WScript.Network")  &lt;br&gt;  Set fso = WScript.CreateObject("Scripting.FileSystemObject")  &lt;br&gt;  Set WshShell = Wscript.CreateObject("Wscript.Shell")&lt;/b&gt; &lt;br&gt;  &lt;b&gt; &lt;br&gt;  WScript.Echo "Your IP Address will release and renew with this script"  &lt;br&gt;  fso.CopyFile "&lt;/b&gt;&lt;b&gt;&lt;i&gt;\\networkpath&lt;/i&gt;&lt;/b&gt;&lt;b&gt;", "C:\test\"  &lt;br&gt;  WshShell.run("%comspec% /k c:\test\&lt;i&gt;batFileName.bat&lt;/i&gt;") &lt;/b&gt; &lt;br&gt;  &lt;b&gt;WScript.Sleep 2500 &lt;br&gt;  fso.DeleteFile "c:\test\&lt;i&gt;batFileName.bat&lt;/i&gt;"  &lt;br&gt;  &lt;/b&gt; &lt;br&gt;  I am pretty sure that you dont need the OPTION EXPLICIT or QUIT.&amp;nbsp; I did not have luck getting it to copy the file to the local C drive, but it works if you copy it to a folder on the local drive, as I have shown in the above script.&amp;nbsp;  &lt;br&gt;  You might want to use what I have above, and just put in your server pah and .bat file name. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Thantos &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25506</link><pubDate>Fri, 02 Sep 2005 09:47:38 GMT</pubDate></item><item><title> RE: renew IP address in login script (mbouchard)</title><description>  Try telling it where the cmd.exe is.&amp;nbsp; Something like this. &lt;br&gt;    &lt;br&gt;   If fso.FileExists("c:\windows\system32\cmd.exe") then &lt;br&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp; WshShell.Run "c:\windows\system32\cmd.exe /C c:\rapid.bat" &lt;br&gt;   ElseIf fso.FileExists("c:\winnt\system32\cmd.exe") then &lt;br&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp; WshShell.Run "c:\winnt\system32\cmd.exe /C c:\rapid.bat" &lt;br&gt;   Else &lt;br&gt;   &amp;nbsp;&amp;nbsp;&amp;nbsp; Msgbox "Something is wrong" &lt;br&gt;   End If &lt;br&gt;    &lt;br&gt;   I am just wondering if comspec is not working as the environment variables are not set/configured/whatever.&amp;nbsp; Not sure of the timing. &lt;br&gt;    &lt;br&gt;    &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25501</link><pubDate>Fri, 02 Sep 2005 09:38:35 GMT</pubDate></item><item><title> RE: renew IP address in login script (kracksmith)</title><description>  it's not running the .bat file.  &lt;br&gt;  &amp;nbsp; &lt;br&gt;  %comspec% means it suppose to go to windows/system32/cmd.exe right?&amp;nbsp; somehow it's not opening up a command prompt for the .bat to take into effect &lt;br&gt;  &amp;nbsp; &lt;br&gt;  am i leaving anything out of my script below? &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Option Explicit &lt;br&gt;  Dim network, fso &lt;br&gt;  Set network = CreateObject("WScript.Network") &lt;br&gt;  Set fso = CreateObject("Scripting.FileSystemObject") &lt;br&gt;  WScript.Echo "Your IP Address will release and renew with this script" &lt;br&gt;  fso.CopyFile "\\Prod2\N_Drive\Public\Prod2 Print Scripts\rapid.bat", "C:\" &lt;br&gt;  WshShell.run("%comspec% /c c:\rapid.bat")  &lt;br&gt;  &lt;b&gt;fso.DeleteFile "c:\rapid.bat"&lt;/b&gt; &lt;br&gt;  quit &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25499</link><pubDate>Fri, 02 Sep 2005 09:30:32 GMT</pubDate></item><item><title> RE: renew IP address in login script (thantos_kalev2001)</title><description>  Try this code to get it to execute: &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &lt;b&gt;WshShell.run("%comspec% /c c:\rapid.bat")&lt;/b&gt; &lt;br&gt;  &lt;b&gt;&lt;/b&gt;&amp;nbsp; &lt;br&gt;  And then this to delete the file locally: &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &lt;b&gt;fso.DeleteFile "c:\rapid.bat"&lt;/b&gt; &lt;br&gt;  &lt;b&gt;&lt;/b&gt;&amp;nbsp; &lt;br&gt;  Cheers! &lt;br&gt;  Thantos &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25498</link><pubDate>Fri, 02 Sep 2005 09:17:15 GMT</pubDate></item><item><title> RE: renew IP address in login script (kracksmith)</title><description>  Thanks for your assistance &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Here is what i have so far. it will copy the "release &amp;amp; renew.bat file" from the server to their C directory but i can't get it to run.  &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  also i need to delete this .bat file once it completes it's duties. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Option Explicit &lt;br&gt;  Dim network, fso &lt;br&gt;  Set network = CreateObject("WScript.Network") &lt;br&gt;  Set fso = CreateObject("Scripting.FileSystemObject") &lt;br&gt;  WScript.Echo "Your IP Address will release and renew with this script" &lt;br&gt;  fso.CopyFile "\\Prod2\N_Drive\Public\Prod2 Print Scripts\rapid.bat", "C:\" &lt;br&gt;  'WshShell.Run "cmd /c rapid.bat" &lt;br&gt;  quit &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25497</link><pubDate>Fri, 02 Sep 2005 08:52:36 GMT</pubDate></item><item><title> RE: renew IP address in login script (mbouchard)</title><description>  One thing to keep in mind, as soon as you release you will lose your connection to your netlogon share and there is a strong possibility that the script will not work properly.&amp;nbsp; What I would recommend is this, create a script and save it in your netlogon share.&amp;nbsp; This script would essentally do what thantos says below.&amp;nbsp; Release the IP, renew the IP, then it would check for the login script, you can have a loop here that would check every few seconds.&amp;nbsp; And once it can see the login script, it 1) writes a log file that is used by the login script, this would be used to prevent it from copying and running the ipconfig renew script again, 2) Runs the login script, and 3) deletes itself. &lt;br&gt;    &lt;br&gt;   Now, in your login script do something like this: &lt;br&gt;    &lt;br&gt;   If Tagfile doesn't exist Then &lt;br&gt;   Copy ip renew script to PC &lt;br&gt;   run ipscript &lt;br&gt;   quit &lt;br&gt;   End If &lt;br&gt;    &lt;br&gt;   Then when your sure all PC's have been renewed, you can change the code to delete the tag file if it does exist. &lt;br&gt;    &lt;br&gt;   One note, do not call the 2nd script ipconfig.vbs.&amp;nbsp; It will not work properly as it will try to run the ipconfig.exe. &lt;br&gt;    &lt;br&gt;    &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25439</link><pubDate>Thu, 01 Sep 2005 10:19:59 GMT</pubDate></item><item><title> RE: renew IP address in login script (thantos_kalev2001)</title><description>  You could call a command line in a vbscript and just use ipconfig/release and ipconfig/renew. &lt;br&gt;   &lt;br&gt;  For example: &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &lt;b&gt;Set objShell = Wscript.CreateObject("Wscript.Shell")&lt;/b&gt; &lt;br&gt;  &lt;b&gt;objShell.run("%comspec% /k ipconfig /release")&lt;/b&gt; &lt;br&gt;  &lt;b&gt;objShell.run("%comspec% /k ipconfig /renew")&lt;/b&gt; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Thantos Kalev &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=25436</link><pubDate>Thu, 01 Sep 2005 09:57:14 GMT</pubDate></item></channel></rss>
