Jump to content

Mike88

Member
  • Posts

    41
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Luxembourg

Everything posted by Mike88

  1. I would use FORFILES if Win2k and WinXP had it too. Here is an example what i meant before with the first subfolders. Depending on the situation the directory where the file could be located would be like this: <drive>:\OEM\RunOnceEx\test.cmd<drive>:\<path>\OEM\RunOnceEx\test.cmd<drive>:\<path>\<path>\OEM\RunOnceEx\test.cmd<drive>:\<path>\<path>\<path>\OEM\RunOnceEx\test.cmd...
  2. Okay now i'm understanding better how the script works, i nerver use ASCII in a batch file before. I wish i could also included the subfolders but i think that would make everything more complicated, because only the last 2 subfolders will be the same everything at the bgeing of the path is not always the same.
  3. Thanks this is now working perfect. Any reason why you used "90 -1 65" insteal of "MOUNTVOL"? I never saw "90 -1 65" in a batch script before. Would be nice to know how this script works because it does not work with "@ECHO ON".
  4. Thanks for the HTA script you always do great HTA scripts. But unfortunately i have to use a batch script that automatically search for a file in all drives and execute it if found. This batch script will be also a part of some other batch scripts, that's way i have to do it in Batch code. Yzöwl batch script works but i still have to find out how to change the script so that it will automatically execute the file if it was found in a drive.
  5. @gunsmokingman I always included the file type that's way the VBScript didn't work: It's now working if i don't included the file type.
  6. @gunsmokingman I also tried you input VBScript but it also couldn't find the test.cmd file. A Batch script is also a more easy way for me to integrate into my existing Batch script. @Wise Owl This now works nicely do you also know how to do it so it would execute the test.cmd file if found?
  7. The first batch script only works if the test.cmd file is in the same directory or in the drive root directory. The VBScript didn't work for me it always says, Missing file. [EDIT] The linked batch script looks promising i will play a little bit more with it. @Yzöwl I couldn't get the last script you posted working, what's the difference between your linked batch script and the one you posted?
  8. HI, I try to do a little script that would search in all drives for a specific file but i had no luck to get this script to work. Anyone here that could help me out with this or has a better script idea? SETLOCAL EnableDelayedExpansionSET FindFile=test.cmdFOR /F %%a IN ('MOUNTVOL^|FINDSTR [A-Z]:\\') do ( FOR /F "tokens=*" %%b in ('DIR /B /S "%%a%FindFile%" 2^>nul') do ( SET "FoundFile=%%b" & GOTO FOUND ))ECHO ERROR: File not found.PAUSEEXIT:FOUNDECHO File found in "%FoundFile%".ENDLOCALPAUSEEXIT      
  9. HI, Does anyone know a script to show the last redirect from a user? [EDIT] This is what i was looing for: <?php$referrer = $_SERVER['HTTP_REFERER'];print "Referrer = " . $referrer . "<BR>";?>
  10. Oh i didn't know this wouldn't be possible with VBS. You HTA Script works nicely i only found a little typo "RegisteredOrganizatio" = "RegisteredOrganization" ('n' was missing) Thanks for this Scripty.
  11. HI, I found a VBScript that can change the Windows registration owner and organisation but i want to tweak this script so that it would be possible to enter this two entries in one window instead of 2 popups, like: Change Registrated Owner: <user_input> Change Registrated Organisation: <user_input> Option ExplicitSet ws = WScript.CreateObject("WScript.Shell")Dim ws, t, p1, p2, n, g, cn, cgDim itemtypep1 = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\"n = ws.RegRead(p1 & "RegisteredOwner")g = ws.RegRead(p1 & "RegisteredOrganization")t = "Change Owner and Organization Utility"cn = InputBox("Type new Owner and click OK", t, n)If cn <> "" Then ws.RegWrite p1 & "RegisteredOwner", cnEnd Ifcg = InputBox("Type new Organization and click OK.", t, g)If cg <> "" Then ws.RegWrite p1 & "RegisteredOrganization", cgEnd IfWScript.Quit
  12. Nice this works fine would it be also possible to use it with "pause(MillisecondsOrSeconds)"?
  13. I tried my best but i couldn't get it to work, It won't pause 10 seconds before executing the other task. <!--This code is property of Gunsmokingman and Or Jake1Eye and you must have his permission to use.This is only posted as example code and meant only to used as such.--><TITLE> TESTSCRIPT </TITLE><HTA:APPLICATION ID="TESTSCRIPT" SCROLL="no" SCROLLFLAT="no" SINGLEINSTANCE="yes" SHOWINTASKBAR="yes" SYAMENU="yes" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="yes" CONTEXTMENU="no" NAVIGABLE="no" BORDER="thin" BORDERSTYLE="normal" INNERBORDER="no" CAPTION="yes" WINDOWSTATE="normal" APPLICATIONNAME="TESTSCRIPT" ICON="%SystemRoot%\explorer.exe"><script language="JavaScript">//-> Resize And Place In Approx Centerwindow.resizeTo(260,200)window.moveTo(screen.availWidth/2-(260/2),screen.availHeight/2-(200/2))//-> Objects For Runtimevar Act = new ActiveXObject("Wscript.Shell");var fso = new ActiveXObject("Scripting.FileSystemObject");var Wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2");//-> Runtime Variblevar c34 = String.fromCharCode(34);var HtaPath = TESTSCRIPT.commandLine.replace(c34,"");var basepath = new Array;var Tm1 = "";//-> Body OnLoad Functionwindow.onload=function() { basepath = HtaPath.split('\\'); basepath.pop(); basepath = basepath.join('\\'); Act.CurrentDirectory = basepath; setInterval("blinkit()",800);}//-> Blinking Text for <blink></blink> tagfunction blinkit() { if (!document.all) return; else { for(i=0;i<document.all.tags('blink').length;i++) { s=document.all.tags('blink')[i]; s.style.visibility=(s.style.visibility=="visible") ?"hidden":"visible"; } }}//-> Start The Timerfunction pause(){ Tm1=window.setInterval("TheTimeOut()",10000);}//-> End Timerfunction TheTimeOut(){ window.clearInterval(Tm1); alert("Ten Seconds Time Out Completed")}//-> Process Only Checked Checkboxesfunction submit() { for (var i = 0; i < cbo.length; i++) { if (cbo[i].value==null==false && cbo[i].checked) { try { display.innerHTML=(cbo[i].indicator); Act.Run(cbo[i].value.split("%CurDir%").join(basepath),1,true); } catch(e) { alert("COULD NOT EXECUTE:" + '\n' + cbo[i].value.split("%CurDir%").join(basepath)); } pause(); } } display.innerHTML="<font color=\"#009900\"><b>Finished</b></font>"; pause(); window.close();}</script><body><table width="100%" align="center" border="1"> <td valign="top"> <table> <tr> <td class="c1">Start Calculator</td> <td><input type="checkbox" id="cbo" name="checkbox1" indicator="<b>Starting Calculator</b> <blink>Please wait...</blink>" value='"%WinDir%\system32\calc.exe"' checked></input> </td> </tr> <tr> <td class="c1">Start Notepad</td> <td><input type="checkbox" id="cbo" name="checkbox2" indicator="<b>Starting Notepad</b> <blink>Please wait...</blink>" value='"%windir%\system32\notepad.exe"' checked></input> </td> </tr> <tr> <td class="c1">Start Paint</td> <td><input type="checkbox" id="cbo" name="checkbox2" indicator="<b>Starting Paint</b> <blink>Please wait...</blink>" value='"%SystemRoot%\system32\mspaint.exe"' checked></input> </td> </tr> </table> </td> <tr> <td colspan="3" align="center" id="display" class="display"></td> </tr></table><table width="60%" align="center" style="margin:8px 0px 0px 0px;"> <tr> <td align="center"><button type="button" id="btc" Style="width:100px;" onmouseover='this.className="button_hover"' onmouseout='this.className=""' onclick="submit()">Submit</button></td> <td align="center"><button type="button" id="btc" Style="width:100px;" onmouseover='this.className="button_hover"' onmouseout='this.className=""' onclick="window.close();">Quit</button></td> </tr></table></body>
  14. HI, I'm trying to add a 10 seconds wait to a part of a script but i have problems to do this. I tried some stuff from the internet but i couldn't get it to work except one script, but with that i got a warning message about the Javascript running too slow. function submit() { for (var i = 0; i < cbo.length; i++) { if (cbo[i].value==null==false && cbo[i].checked) { try { Act.Run(cbo[i].value.split("%CurDir%").join(basepath),1,true); // Trying to add a 10 seconds wait. } catch(e) { alert("COULD NOT EXECUTE:" + '\n' + cbo[i].value.split("%CurDir%").join(basepath)); } } } // Trying to add a 10 seconds wait. window.close();}
×
×
  • Create New...