topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday June 29, 2025, 10:11 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 123 124 125 126 127 [128] 129 130 131 132 133 ... 225next
3176
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 09, 2013, 05:42 AM »
I have found that the icon sometimes remains when I disconnect and the only way to get rid of it is to close the program using the task manager.

Or perhaps right-click on the icon and select Exit?  ;)

Next time it happens please open a CLI and type rasdial.exe and copy the results.  If it says "No connections" then there is a problem.

When I close the connection and the icon does disappear it takes about 5 seconds by my reckoning, I am not sure if this is related to the polling delay or a shutdown delay, either way could it be reduced to say 2 seconds?

I can change it easily enough but there will be an attendant CPU load increase also, (due to less time in idle state and calling rasdial more often).  Still looking at a better way to get connection state - possibly just by hitting the performance counters.

Does the latest version of PPTPchek replace the previous version if someone is still using batch files or do they work in different ways?

Replaces, it only requires an optional delay, it will pick up the connection name from what rasdial reports.

I think I mentioned somewhere that I am in touch with a VPN developer/provider, would you have any objections if details/instructions for PPTPchek were put on his website, it would of course be credited to you?

Not a problem, maybe I'll add a /? so you can get the CLI parameters, (like a normal DOS command).
3177
Living Room / Re: What books are you reading?
« Last post by 4wd on May 08, 2013, 11:32 PM »
Just finished all 14 books of Andy McNab' Nick Stone series, now onto Flashforward by Robert Sawyer.

41eL1vf1y1L._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA278_PIkin4,BottomRight,-52,22_AA300_SH20_OU01_.jpg

Question for all you book nuts, anyone know where I can get ebook versions of L. P. Davies'w novels?

My dad has most of his in hardcover, so I can always go nick them, but I'd like to read them again, (it's some of the best sci-fi I've read), on my phone rather than cart a book around.

Actually, I should nick them anyway before they end up in an Op Shop.  :-\
3178
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 08, 2013, 11:24 AM »
I can't read the print in your images even with a magnifier (blurred) , I think I can work most of it out except for what is in the second and third boxes in step 4?

Click on the images, they're much bigger than they appear. :)

Or just use PPTPchek.exe 600 in your batch file.
3179
General Software Discussion / Re: Advice needed on AHK script
« Last post by 4wd on May 08, 2013, 06:44 AM »
Just tried the new version of CleanTray, it removed all 4 icons instantly, it left 4 empty spaces at the right hand end of the tray (with the Task Manager NOT running), it rearranged the icons. Basically it's doing the same as the previous version.

And that's running it as:

CleanTray.exe 5

(or at least some number from 1 to 100) ?

The fact you said instantly kind of indicates that you didn't specify an argument, otherwise you'd be able to watch the mouse move around, ie. it's not instant.
3180
Living Room / Re: Can we compare file transfer protocols?
« Last post by 4wd on May 08, 2013, 02:09 AM »
No problem, I'm used to being ignored  :lol:
3181
Post New Requests Here / Re: IDEA: Folder Zipper
« Last post by 4wd on May 08, 2013, 01:57 AM »
I know it's not a multi-megbyte monster with a nice GUI....but if you don't mind a simple batch command:

Code: Text [Select]
  1. REM 7z2CBZ.cmd
  2. @echo off
  3. %~d1
  4. cd %~dp1
  5. for /d %%X in (%*) do (
  6. cd "%%~nxX"
  7. REM edit line below to include path to 7z.exe
  8. C:\batchfiles\7z.exe a "..\%%~nxX.cbz" *.* -mx5 -tzip
  9. cd ..
  10. )

Put the batch file somewhere, edit it so that it's pointing to 7z.exe, then create a shortcut to it in %USERPROFILE%\SendTo, eg.

2013-05-08 16_42_53-C__Users_4wd_AppData_Roaming_Microsoft_Windows_SendTo.png

To use: select your folders in Explorer, DOpus, etc, right-click and select Send To -> 7z2CBZ

eg. From this:

2013-05-08 16_47_21-.png

You should end up with something like this:

2013-05-08 16_47_48-U__jkkjkj.png

Obligatory warning: There's no checking for any kind of error, eg. if you selected files instead directories.  That said, it works for me :)

A breakdown of what it does:
%~d1    Take the drive of the first argument and change to it
cd %~dp1    Take the path of the first argument and CD to it
for /d %%X in (%*) do (     For every argument passed to the batch file
cd "%%~nxX"    CD to the directory
C:\batchfiles\7z.exe a "..\%%~nxX.cbz" *.* -mx5 -tzip    Create the archive in the parent directory
cd ..    Change back to the parent directory


UPDATE: Got rid of the move command.
3182
General Software Discussion / Re: Advice needed on AHK script
« Last post by 4wd on May 07, 2013, 08:24 PM »
Seems to me that you'd be better off with a program that terminates a process and removes
any tray icon left by the terminated program, then you'd only need three lines in your batch file.

Or a task killer that sends a proper program exit command so the program can shut itself down cleanly.
3183
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 07, 2013, 08:08 PM »
Yes, I could just change it so it ran all the time if no arguments were passed.

In that case, with its current method of working, I'd probably have the default interval changed to 10-15 seconds.

EDIT: Or in Win7, there's probably an EventID when a connection is made that you could use to trigger a Scheduled Task.

Here we go, this should work for Vista and later, (including WHS2008+) - requires latest PPTPchek.exe (0.3.0.16):

1) Run Task Scheduler and select Create Basic Task

2013-05-08 14_29_03-Task Scheduler.png

2) Give your task a name, (and a description if you want), then hit Next:

2013-05-08 14_30_23-Create Basic Task Wizard.png

3) Select When a specific event is logged then hit Next:

2013-05-08 14_30_34-Create Basic Task Wizard.png

4) Set up the Trigger as below and hit Next:

2013-05-08 14_31_14-Create Basic Task Wizard.png

5) Choose Start a program, hit Next:

2013-05-08 14_31_22-Create Basic Task Wizard.png

6) Fill out the fields with the appropriate info, hit Next:

2013-05-08 15_26_58-Create Basic Task Wizard.png

7) Hit Finish

2013-05-08 15_27_38-Create Basic Task Wizard.png

Job done!  Program will run when a PPTP connection is made.

(And no, the Task Scheduler in XP isn't intelligent enough to do this.  :) )
3184
Finished Programs / Re: SOLVED: Absolutely Basic Count-up Timer (ABC Timer)
« Last post by 4wd on May 07, 2013, 12:54 AM »
If you
Maybe I'm wrong but that looks like it's a countdown timer.

If you set the minutes to zero, it acts as a countup timer.   :)

My mistake  :-[
3185
Finished Programs / Re: SOLVED: Absolutely Basic Count-up Timer (ABC Timer)
« Last post by 4wd on May 07, 2013, 12:48 AM »
My bet is on SnapTimer.  =]

Maybe I'm wrong but that looks like it's a countdown timer.

I think a basic stopwatch program that starts when run is nearer the mark, perhaps tranglos' Stopwatch ?

Or the SwiftTec version is even simpler.
3186
General Software Discussion / Re: Creating thumbnails from AVCHD .mts files?
« Last post by 4wd on May 07, 2013, 12:20 AM »
Nod5 created a script for doing it here and fredkremenko did one here.

Should still work unless the interface of MPC/MPC-HC have radically changed.

EDIT: One day I'll learn to look at the preceding post dates more carefully  :wallbash:
3187
General Software Discussion / Re: Advice needed on AHK script
« Last post by 4wd on May 06, 2013, 11:46 PM »
The one question I have to ask is: What are you doing that leaves so many orphaned icons so often?

Also, I'd be interested to know if the attached version of CleanTray works, I've modified it so that it works one of two ways which I'll refer to as Nuke'em and Boring :)

CleanTray.exe [anything]

Where: [anything] = anything, any argument at all.

A number from 1 to 100 = Boring slow way = moving mouse over all the icons, the lower the number the faster it moves, I suggest you start with 5.
No args, a string or 0 = Nuke'em = Much faster with an absolute total disregard of resulting icon order, (the way I like since I have to restart explorer.exe to get all the icons to show up in the first place).

So in your case, try:

C:\> CleanTray.exe 2


I realise that AutoIt and AHK are two different languages but it seems that we have one script that removes ALL orphaned icons but plays havoc with icon location and a second script that only affects orphaned icons but will not remove more than 2 at a time. Putting aside the different languages they are written in what are they actually doing differently?

AutoIt script, (original CleanTray), gets the number of icons in the tray then asks for the process that controls that icon.  If no process is returned the icon is removed - obviously in using the appropriate system calls to remove the icon, it also removes the positioning info.

The first AutoHK script moves the mouse over the icons but you need to specify a coordinate offset based on your screen parameters.  The second AutoHK script works the same as CleanTray by using system calls to detect icons without processes and then removing them.

The new CleanTray works depending on the passed argument:
a) The original way, ie. just removes the icon if it has no background process.
b) Locates the tray, gets the number of icons, it then loops backwards through the list getting the icon' background process.  If an icon has no background process, the mouse is moved to it, Windows will then remove it, (as it usually does).  If an icon is removed it will exit the loop, get the new number of icons and start again, ie. it will recurse, (kind of), through the icon list until it gets to the point where no icons are removed.

REDUNDANT: See below
3188
General Software Discussion / Re: Advice needed on AHK script
« Last post by 4wd on May 06, 2013, 09:25 AM »
And yet another option :)

Here's a simple AutoIt script that will bounce the mouse over tray icons that have a running process, it may pick up orphaned icons as it jumps from one to another.

It's just a modified version of the SysTray_Example.au3 found here along with the UDF by tuape.

Attached code redundant - see below.
3189
General Software Discussion / Re: [IDEA] put places on map
« Last post by 4wd on May 05, 2013, 05:50 AM »
If you put them into a spreadsheet then you can import into Maptive or Spreadsheets -> Map Wizard.

3190
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 04, 2013, 09:07 PM »
Something I realised when I was changing VPN's is there is no indication as to which one is connected, the icon is showing 'PPTPcheck.exe' when I move the cursor over it.

Short term memory loss ?  ;)

EDIT: For some weird reason I can't get the ToolTip to change to something other than the executable name, (I was going to make it the passed NIC name), more reading to be done.

To avoid any problems I have put a shortcut in the toolbar to the OFF batch file, it works for all PPTP connections (L2TP as well) and still only needs one click.
This is probably not necessary but sometimes I finished up with the PPTPcheck icon out of synch with the connection status, a couple of clicks on any ON icon sorts it out but this stops it happening.

I don't see how that can happen unless you're switching connections faster than the 5 second interval PPTPchek uses between rasdial.exe calls, ie. the longest PPTPchek should be active after a disconnection is 5 seconds.

This was a trade-off between increased CPU usage and a reasonably short update period - there's probably another way I could use to check connection status, (using a WMI or DLL call), but rasdial.exe was quick and easy.  I might look into it a bit further.

When I first started using them there were hardly any about and few if any of them were free, now they are popping up all over the place although I'm not sure that I would trust the security of some of them.

But since most of them are purely for the purpose of accessing region restricted media content, that shouldn't be a problem.

UPDATE: PPTPchek
  • Start monitor delay will be terminated as soon as the rasdial.exe process terminates.
  • ToolTip now indicates connection name.
3191
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 04, 2013, 05:59 AM »
Code: Text [Select]
  1. rasdial.exe | find /i "no connections" >NUL
  2. if errorlevel 1 goto running
  3. rem prog is not running
  4. cmdow.exe /run rasdial.exe PPTP-UK freecloudvpn.com 1702
  5. cmdow.exe /run /hid PPTPchek.exe PPTP-UK 60
  6. goto alldone
  7. :running
  8. rem prog is already running
  9. cmdow.exe /run rasdial.exe /disconnect
  10. :alldone

Tested working on WHS2011, (equivalent to Win7 x64), running it from the directory in which cmdow.exe, PPTPchek.exe and the batch file all reside.

Run it from a shortcut and no CLI windows are left open.

No separate OFF batch file required, just the ON ones.

(That's a free VPN BTW, password changes every few hours.)
3192
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 03, 2013, 10:51 PM »
Use Cmdow instead of Start - an old standby from the heady days of DOS.

Cmdow - Cmdow is a Win32 commandline utility for NT4/2000/XP/2003 that allows windows to be listed, moved, resized, renamed, hidden/unhidden, disabled/enabled, minimized, maximized, restored, activated/inactivated, closed, killed and more.

eg. cmdow.exe /run /hid pptpchek.exe US-VPN 20

Only the Netload download link seems to be working at this time.

NOTE: Your AV program will probably hate it unless you tell it to ignore it - although MSE and MBAM seem OK with it.

It'll do until I work out how to detach from the CLI, which seems to be surprisingly hard, (or obscure).
3193
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 03, 2013, 06:43 AM »
Before I leave this subject I have one further question if you don't mind:

All it does is call rasdial.exe every 5 seconds, if the named connection no longer exists the program exits.

I have been trying for a long time to find a way to put an argument into a batch file that states: 'if PPTP is (not) connected then........'.
Can your idea be used in that way and if so how would it read?

Off the top of my head, something along the lines of:

Code: Text [Select]
  1. rasdial.exe | find /i "no connections" >NUL
  2. if errorlevel 1 goto running
  3.  
  4. echo No PPTP connection
  5.  
  6. goto alldone
  7. :running
  8.  
  9. echo PPTP connection exists
  10.  
  11. :alldone

ie.
Execute rasdial and pipe the output to FIND to search for "no connections", (case insensitive), if it doesn't exist the errorlevel will be 1 so we jump to the running label.

You have made using my computer a little bit easier and saved me countless hours of trying to sort this out myself, at the end of which I would probably have given up.

No problem, gives me something to do besides blast things in Borderlands 2  ;D
3194
General Software Discussion / Re: Steam, and customer satisfaction
« Last post by 4wd on May 03, 2013, 05:02 AM »
@Target: If you want to save your data allowance let me know, I'll make sure my CoD: MW3 install is up to date, archive it onto DVD and mail it to you.

BTW, the 35GB install seems excessive - it only takes up 14.2GB on both my XP and Win7 machines.
3195
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 02, 2013, 10:20 PM »
Thanks - looks like this is going to be a bit of fun, the PPTP not having a physical connection means I need another way to see if it's online, (possibly something as simple as count the number of IPs periodically).

Quick question, do you only ever have one PPTP VPN connected at a time?

EDIT: Worked out how - some things are so easy once you stop looking too hard  :-[


PPTPchek - Simple PPTP connection monitor (I'm starting to run out of names)

Nothing fancy, same command args as ConnStat above:

PPTPcheck.exe [delay]       - delay = optional delay before monitoring starts
eg. PPTPchek.exe 30

All it does is call rasdial.exe every 2 seconds, if the named connection no longer exists the program exits.

Code: AutoIt [Select]
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=netshell_190.ico
  3. #AutoIt3Wrapper_UseUpx=n
  4. #AutoIt3Wrapper_Res_Fileversion=0.3.0.20
  5. #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
  6. #AutoIt3Wrapper_Res_Icon_Add=netshell_193.ico
  7. #AutoIt3Wrapper_Res_Icon_Add=netshell_191.ico
  8. #AutoIt3Wrapper_Res_Icon_Add=netshell_192.ico
  9. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  10.  
  11. #comments-start
  12.  
  13. PPTPchek- Displays an icon in the SysTray while the specified PPTP connection exists
  14.  
  15. PPTPchek.exe [delay]
  16.  
  17. where: [delay]       = Optional delay before monitoring starts (in seconds)
  18.  
  19. eg.  PPTPchek.exe 30
  20.  
  21. Tray icon will  change colour at the end of the delay period, (if given or when rasdial.exe has finished), to indicate monitoring has begun.
  22.  
  23. NIC status will be checked every 2000 milliseconds.
  24.  
  25. PPTPchek can be terminated by causing the PPTP connection to disconnect, (eg. pull the cable), or choosing Exit from the icon context menu.
  26.  
  27. If the icon is flashing between its normal icon and a red cross it indicates the program is PAUSED - use the context menu to unpause.
  28. #comments-end
  29.  
  30. #include <Constants.au3>
  31. #include <StaticConstants.au3>
  32.  
  33. Opt("TrayAutoPause", 0)
  34.  
  35. TraySetState()                                                                   ; Show tray icon
  36. If $CmdLine[0] > 1 Then
  37.         If Int($CmdLine[2]) > 0 Then
  38.                 $j = 0
  39.                 $i = TimerInit()
  40.                 While $j < Int($CmdLine[2]) * 1000                          ; Loop until delay expired
  41.                         $j = TimerDiff($i)
  42.                         If ProcessExists("rasdial.exe") = 0 Then ExitLoop   ; If rasdial.exe process doesn't exist, exit the loop
  43.                         Sleep(1000)
  44.                 WEnd
  45.         EndIf
  46. TraySetState(2)                                                                 ; Hides tray icon after delay
  47. TraySetIcon(@ScriptName, -5)                                         ; Change icon
  48. TraySetState(1)                                                                 ; Show tray icon, ie. monitoring starts
  49.  
  50.         If _GetState() = "" Then _Exit()
  51.         Sleep(2000)
  52.  
  53.  
  54. Func _Exit()
  55.         Exit
  56.  
  57.  
  58. Func _GetState()
  59.         While ProcessExists("rasdial.exe")
  60.                 Sleep(250)
  61.         WEnd
  62.         Local $foo = Run(@comspec & ' /c rasdial.exe', '.', @SW_HIDE, $STDOUT_CHILD)
  63.         If @error Then
  64.                 MsgBox(48, "PPTPchek", "PPTPchek: Failed to run rasdial.exe")
  65.         EndIf
  66.         Local $output
  67.         $output = ''
  68.         While 1
  69.                 $output &= StdoutRead($foo)
  70.             If @error <> 0 Then ExitLoop
  71.         WEnd
  72.         StdioClose($foo)
  73.         If StringInStr($output, "No connections") Then Return ""
  74.         Local $temp = StringSplit($output, @CRLF)
  75.         TraySetToolTip($temp[2])
  76.         Return $temp[2]

UPDATE:
  • Monitoring delay will be terminated as soon as the rasdial.exe process terminates.
  • ToolTip now indicates connection name.
  • Doesn't need a connection argument, (for running via Task Scheduler)
  • Checks to see if rasdial.exe is running before executing it
  • Interval changed to 2 seconds
3196
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 02, 2013, 08:15 AM »
Can you run the attached program when you have a PPTP VPN connected, select all the lines in the output window, copy then paste into a text file and attach it to a reply here?

Doesn't do anything strange, just reports information regarding network devices: device names, status, etc - no secret information, (source included so anyone can check).
3197
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 02, 2013, 06:53 AM »
Simple connection monitor: ConnStat.exe

The simple part: an icon = connected; no icon = disconnected


ConnStat - Connection Status

ConnStat.exe <adapter> [delay]

where: <adapter >= NIC adapter name as given under Windows Network Connections, use quotes if necessary
            [delay]    = Optional delay before monitoring starts (in seconds)

eg.  ConnStat.exe "virtualbox host-only network" 30

Tray icon will change colour at the end of the delay period, (if given), to indicate monitoring has begun.

If the NIC given does not exist or it does not have a status of Connected, the program will exit.

NIC status will be checked every 1000 milliseconds.

ConnStat can be terminated by causing the NIC to disconnect, (eg. pull the cable, disable it, nuke the destination, etc), or choosing Exit from the icon context menu.

If the icon is flashing between its normal icon and a red cross it indicates the program is PAUSED - use the context menu to unpause.


Code: AutoIt [Select]
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=netshell_193.ico
  3. #AutoIt3Wrapper_UseUpx=n
  4. #AutoIt3Wrapper_Res_Icon_Add=netshell_190.ico
  5. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  6.  
  7. #comments-start
  8.  
  9. ConnStat - Connection Status
  10.  
  11. ConnStat.exe <adapter> [delay]
  12.  
  13. where: <adapter >= NIC adapter name as given under Windows Network Connections, use quotes if necessary, it's case-insensitive
  14.             [delay]    = Optional delay before monitoring starts, (in seconds).
  15.  
  16. eg.  ConnStat.exe "virtualbox host-only network" 30
  17.  
  18. Tray icon will change colour at the end of the delay period, (if given), to indicate monitoring has begun.
  19.  
  20. If the NIC given does not exist or it does not have a status of Connected, the program will exit.
  21.  
  22. NIC status will be checked every 1000 milliseconds.
  23.  
  24. ConnStat can be terminated by causing the NIC to disconnect, (eg. pull the cable), or choosing Exit from the icon context menu.
  25.  
  26. If the icon is flashing between its normal icon and a red cross it indicates the program is PAUSED - use the context menu to unpause.
  27. #comments-end
  28.  
  29. #Include <Array.au3>
  30.  
  31. ; No command line args = message and exit
  32. If $CmdLine[0] = 0 Then
  33.         MsgBox(48, "ConnStat", "Command format:" & @CRLF & "ConnStat.exe <network connection> [delay]" & @CRLF & @CRLF & 'eg. ConnStat.exe "Local Area Connection 2" 30')
  34.         _Exit()
  35.  
  36. TraySetState()                                                                   ; Show tray icon
  37. $checkConn = $CmdLine[1]                                            ; arg 1 = NIC
  38. If $CmdLine[0] > 1 Then
  39.         If Int($CmdLine[2]) > 0 Then Sleep(Int($CmdLine[2]) * 1000)    ; arg2 = optional delay
  40. TraySetState(2)                                                                 ; Hides tray icon appears after delay, ie. monitoring starts
  41. TraySetIcon(@ScriptName, -5)                                         ; Change icon
  42. TraySetState(1)                                                                 ; Show tray icon
  43.  
  44.         $connNICs = _AdaptersConnected()                            ; get NICs with state "connected"
  45.         $i = _ArraySearch($connNICs, $checkConn, 1)            ; search NIC list for our adapter
  46.         If @error Then _Exit()                                                   ; exit if not found
  47.         Sleep(1000)
  48.  
  49.  
  50. Func _Exit()
  51.         Exit
  52.  
  53. ; Function by guiness @ http://www.autoitscript.com/forum/topic/134245-get-netconnection-status/#entry936095
  54. Func _AdaptersConnected($sComputer = @ComputerName)
  55.     Local $aReturn[1] = [0], $iDimension = 0, $oColItems, $oWMIService, $sDelimeter = Chr(01), $sReturn = ""
  56.  
  57.     $oWMIService = ObjGet("winmgmts:\\" & $sComputer & "\")
  58.     $oColItems = $oWMIService.ExecQuery("Select * From Win32_NetworkAdapter Where NetConnectionStatus='2'", "WQL", 0x30)
  59.  
  60.     If IsObj($oColItems) Then
  61.         For $oObjItem In $oColItems
  62.             If $oObjItem.AdapterType = "" Or $oObjItem.NetConnectionID = "" Then ; Ensures that the connections are physical adapters.
  63.                 ContinueLoop
  64.             EndIf
  65.             If StringInStr($sDelimeter & $sReturn, $sDelimeter & $oObjItem.Description & $sDelimeter, 1) Then ; Ensures there are no duplicates.
  66.                 ContinueLoop
  67.             EndIf
  68.             $sReturn &= $oObjItem.Description & $sDelimeter
  69.  
  70.             If ($aReturn[0] + 1) >= $iDimension Then ; http://www.autoitscript.com/forum/topic/...en-you-have-to-resize-an-exist
  71.                 $iDimension = ($aReturn[0] + 1) * 2
  72.                 ReDim $aReturn[$iDimension]
  73.             EndIf
  74.  
  75.             $aReturn[0] += 1
  76.             $aReturn[$aReturn[0]] = $oObjItem.NetConnectionID
  77.         Next
  78.     EndIf
  79.  
  80.     ReDim $aReturn[$aReturn[0] + 1]
  81.     Return $aReturn
  82. EndFunc   ;==>_AdaptersConnected


You can run multiple copies and you can rename the executable to anything you like.

EDIT: For some wierd reason I can't get the ToolTip to change to something other than the executable name, (I was going to make it the passed NIC name), more reading to be done.

NOTE: Currently only works for physical adapters.
3198
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 02, 2013, 02:57 AM »
If the VPN connection drops out the icon stays put, so there is no indication the the connection has dropped.

Half a dozen posts later it has all become clear - all you want is a network connection monitor, nothing to do with batch files at all really.  ;D

If I hover the cursor over the NetConnected icon there is a 'Left-click to execute file and exit' option, what actually happens is that the icon disappears but the VPN stays connected.

It's not an option, it's a ToolTip - what you're saying is that as soon as you hover over the icon you get the ToolTip and then the program exits without you doing anything further, (something it doesn't do on my machine).

Anyway, now that all that's required is a connection monitor it's back to the drawing board  ;)

Icon changed for NetConnected, download archive again.
3199
Coding Snack Guidelines / Re: Count Number of Pages in PDF Files
« Last post by 4wd on May 01, 2013, 02:23 AM »
If you're willing to add a couple of extra files, (besides pdfinfo.exe), to get it working here's a DOS batch/command file that will output:

"Filename", pages

Call as follows:

PDF-Pages.cmd <directory>

Include quotes around the directory path if required, eg. PDF-Pages.cmd "D:\My Documents"

Output goes to a file named output.txt.

Code: Text [Select]
  1. REM PDF-Pages.cmd
  2. @echo off
  3. del output.txt
  4. for /r %1 %%f in (*.pdf) do pdfinfo.exe -meta "%%f" >out.txt & echo "%%f", | tr.exe -d "\r\n" >>output.txt & find "Pages:" out.txt | tr.exe -d "\055\056\072[:alpha:][:space:]" >>output.txt & echo. >>output.txt
  5. del out.txt

You'll need tr.exe, libintl3.dll and libiconv2.dll from coreutils binaries and coreutils dependencies archives available here - put them in the same directory as the batch/command file.

Worked OK here over 380 PDF files in 21 sub-directories.

Anyway, it was an exercise in DOS :D

EDIT: Ooppss!  Just realised not what you're after  :-[
3200
dir /s /on /b /a:d > list.txt

This one is close, about as close as I have come.
the output though is "too complete" as I only need one line for each folder or better stated
I need one line showing the first occurrence of the file index.php, then skipping to the next subdirectory and listing the same thing there.

It'll list every occurrence of index.php but maybe:

dir /s /on /b /a:-d index.php > list.txt

Otherwise, as skwire has said, we need an example input and example output to be able to get the right idea.
Pages: prev1 ... 123 124 125 126 127 [128] 129 130 131 132 133 ... 225next