Page 1 of 1 1
Topic Options
#37847 - 2003-03-12 06:17 PM I have a wierd one......
ArchAngel96 Offline
Getting the hang of it

Registered: 2002-10-20
Posts: 70
I've used the 'Send.kix' as a base to make a script of some routine manual commands. Thou the script itself is a kixforms, I'm having a problem specifically with a portion of it. Here's the function area:


Function send_click
 Dim $name
 $name = $computer.text
 If NOT $name
  $$form.msgbox("Please enter a valid computer name","Computer Name")
  $computer.SetFocus
  Return
 EndIf
 Shell '%comspec% /c ping -n 3 $name | Find "TTL"'
 If @ERROR = 0
     If Exist('\\$name\C$$')
          If Exist('\\$name\c$$\asset.bat')
             Del('\\$name\c$$\asset.bat')
         EndIf
          If Exist('\\$name\c$$\infrtool.ini')
             Del('\\$name\c$$\infrtool.ini')
         EndIf
          If Exist('\\$name\c$$\infrtool.~in')
             Del('\\$name\c$$\infrtool.~in')
         EndIf
          If Exist('\\$name\c$$\infrtool\local$.sem')
             Del('\\$name\c$$\infrtool\local$.sem')
         EndIf
          If Exist('\\$name\c$$\infrtool\local$.xml.gz')
              SetFileAttr('\\$name\c$$\infrtool\local$.xml.gz',128)
             Del('\\$name\c$$\infrtool\local$.xml.gz')
         EndIf
        If Exist("\\$name\c$$\InfrTool\")
                If Exist("\\$name\c$$\infrtool\scanW32.exe")
                     $Compare = CompareFileTimes("\\nt-go-ap3\scans\scanner\scanW32.exe","\\$name\c$$\infrtool\scanw32.exe")
                    If $Compare = -3 OR $Compare = 1
                        Copy "\\nt-go-ap3\scans\scanner\scanW32.exe" "\\$name\c$$\infrtool"
                    EndIf
                Else
                    Copy "\\nt-go-ap3\scans\scanner\scanW32.exe" "\\$name\c$$\infrtool"
                EndIf
                If Exist("\\$name\c$$\infrtool\pdi.exe")
                    $Compare = CompareFileTimes("\\nt-go-ap3\scans\scanner\pdi.exe","\\$name\c$$\infrtool\pdi.exe")
                    If $Compare = -3 OR $Compare = 1
                        Copy "\\nt-go-ap3\scans\scanner\pdi.exe" "\\$name\c$$\infrtool"
                    EndIf
                Else
                    Copy "\\nt-go-ap3\scans\scanner\pdi.exe" "\\$name\c$$\infrtool" 
                EndIf
                Copy "\\nt-go-ap3\scans\scanner\infrtool.ini" "\\$name\c$$"
        Else
            MD "\\$name\c$\InfrTool"
            Copy "\\nt-go-ap3\scans\scanner\infrtool.ini" "\\$name\c$$"
            Copy "\\nt-go-ap3\scans\scanner\pdi.exe" "\\$name\c$$\infrtool\"
            Copy "\\nt-go-ap3\scans\scanner\scanW32.exe" "\\$name\c$$\infrtool\"
        EndIf
         $Hour=Val(Split(@Time,':')[0])
        $Min=Val(Split(@Time,':',-1)[1])
         If $Hour = 24
              $Hour = 0
        EndIf
            Select
            Case $Min => 0 AND $Min < 10
                $NEW$min + 1
                $NewTime = '0'+$New
            Case $Min => 10
                $NEWTIME$min + 1
            EndSelect
         Run '%comspec% /c at \\$name $Hour:$NEWTIME "c:\infrtool\pdi.exe"'
     Else
         $$Form.msgbox("Cannot access the Adminshare"+Chr(13) + Chr(10)+"              on $name","Connection Failed")
     EndIf
 Else
     $$Form.msgbox("The computer does not appear to be online","Ping Failed")
 EndIf
EndFunction



For some reason this area of that function is not working...


        Else
            MD "\\$name\c$\InfrTool"
            Copy "\\nt-go-ap3\scans\scanner\infrtool.ini" "\\$name\c$$"
            Copy "\\nt-go-ap3\scans\scanner\pdi.exe" "\\$name\c$$\infrtool\"
            Copy "\\nt-go-ap3\scans\scanner\scanW32.exe" "\\$name\c$$\infrtool\"
        EndIf


but everything else around this area works fine.
_________________________
penny = the target the playing field = three football fields side by side you = only allowed to stand on the outside of the playing field tool you get to use to find the penny = a ONE INCH LAWN DART get the level of difficulty?

Top
#37848 - 2003-03-12 06:27 PM Re: I have a wierd one......
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
shouldn't it be:
MD "\\$name\c$$\InfrTool"
_________________________
!

download KiXnet

Top
#37849 - 2003-03-12 06:52 PM Re: I have a wierd one......
ArchAngel96 Offline
Getting the hang of it

Registered: 2002-10-20
Posts: 70
Sorry, yes you're right... I've tried that too.. still wouldn't work. I changed it last to see if that was the problem but I got the same results. The script won't even copy the ini file to \\$name\C$$. So it would appear that section is being bypassed.... And I can't figure out why.
_________________________
penny = the target the playing field = three football fields side by side you = only allowed to stand on the outside of the playing field tool you get to use to find the penny = a ONE INCH LAWN DART get the level of difficulty?

Top
#37850 - 2003-03-12 09:45 PM Re: I have a wierd one......
Anonymous
Unregistered


Added an "." in line 29.. seems like the entire "Else" clause never runs...

This should work fine..



Function send_click
 Dim $name
 $name = $computer.text
 If NOT $name
  $$form.msgbox("Please enter a valid computer name","Computer Name")
  $computer.SetFocus
  Return
 EndIf
 Shell '%comspec% /c ping -n 3 $name | Find "TTL"'
 If @ERROR = 0
     If Exist('\\$name\C$$')
          If Exist('\\$name\c$$\asset.bat')
             Del('\\$name\c$$\asset.bat')
         EndIf
          If Exist('\\$name\c$$\infrtool.ini')
             Del('\\$name\c$$\infrtool.ini')
         EndIf
          If Exist('\\$name\c$$\infrtool.~in')
             Del('\\$name\c$$\infrtool.~in')
         EndIf
          If Exist('\\$name\c$$\infrtool\local$.sem')
             Del('\\$name\c$$\infrtool\local$.sem')
         EndIf
          If Exist('\\$name\c$$\infrtool\local$.xml.gz')
              SetFileAttr('\\$name\c$$\infrtool\local$.xml.gz',128)
             Del('\\$name\c$$\infrtool\local$.xml.gz')
         EndIf
        If Exist("\\$name\c$$\InfrTool\.")
                If Exist("\\$name\c$$\infrtool\scanW32.exe")
                     $Compare = CompareFileTimes("\\nt-go-ap3\scans\scanner\scanW32.exe","\\$name\c$$\infrtool\scanw32.exe")
                    If $Compare = -3 OR $Compare = 1
                        Copy "\\nt-go-ap3\scans\scanner\scanW32.exe" "\\$name\c$$\infrtool"
                    EndIf
                Else
                    Copy "\\nt-go-ap3\scans\scanner\scanW32.exe" "\\$name\c$$\infrtool"
                EndIf
                If Exist("\\$name\c$$\infrtool\pdi.exe")
                    $Compare = CompareFileTimes("\\nt-go-ap3\scans\scanner\pdi.exe","\\$name\c$$\infrtool\pdi.exe")
                    If $Compare = -3 OR $Compare = 1
                        Copy "\\nt-go-ap3\scans\scanner\pdi.exe" "\\$name\c$$\infrtool"
                    EndIf
                Else
                    Copy "\\nt-go-ap3\scans\scanner\pdi.exe" "\\$name\c$$\infrtool" 
                EndIf
                Copy "\\nt-go-ap3\scans\scanner\infrtool.ini" "\\$name\c$$"
        Else
            MD "\\$name\c$\InfrTool"
            Copy "\\nt-go-ap3\scans\scanner\infrtool.ini" "\\$name\c$$"
            Copy "\\nt-go-ap3\scans\scanner\pdi.exe" "\\$name\c$$\infrtool\"
            Copy "\\nt-go-ap3\scans\scanner\scanW32.exe" "\\$name\c$$\infrtool\"
        EndIf
         $Hour=Val(Split(@Time,':')[0])
        $Min=Val(Split(@Time,':',-1)[1])
         If $Hour = 24
              $Hour = 0
        EndIf
            Select
            Case $Min => 0 AND $Min < 10
                $NEW$min + 1
                $NewTime = '0'+$New
            Case $Min => 10
                $NEWTIME$min + 1
            EndSelect
         Run '%comspec% /c at \\$name $Hour:$NEWTIME "c:\infrtool\pdi.exe"'
     Else
         $$Form.msgbox("Cannot access the Adminshare"+Chr(13) + Chr(10)+"              on $name","Connection Failed")
     EndIf
 Else
     $$Form.msgbox("The computer does not appear to be online","Ping Failed")
 EndIf
EndFunction

X-mine

[ 12. March 2003, 22:02: Message edited by: X-mine ]

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 633 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.056 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org