PDA

View Full Version : Please debug..whats wrong (WXP-Pro)



mattmac24
02-19-2004, 02:48 AM
this script was made by the very kind unknown634


ive had to cut out all his pointers becuase i was getting a expected end error or somthing

now im getting an illegal left thing..so i just deleted all the left thinsg(but ive put them back) and then after that i has somthing about a virable..anyway i give up

here it is as i have it now


BorderStyle = 1 'Fixed Single
Caption = "Radmin Front-End"
ClientHeight = 2070
ClientLeft = 45
ClientTop = 330
ClientWidth = 3105
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2070
ScaleWidth = 3105
StartUpPosition = 3 'Windows Default
Caption = "Mode (no checks means full control)"
Height = 735
Left = 120
TabIndex = 2
Top = 120
Width = 2895
Caption = "File Transfer"
Height = 255
Left = 1560
TabIndex = 4
Top = 360
Width = 1215
Caption = "Read-Only"
Height = 255
Left = 120
TabIndex = 3
Top = 360
Width = 1215
Caption = "Ping Site"
Height = 375
Left = 120
TabIndex = 1
Top = 1560
Width = 2895
Left = 2400
Top = 1080
Height = 285
Left = 1080
TabIndex = 0
Top = 1080
Width = 1215
Caption = "Site Number"
Height = 255

TabIndex = 5
Top = 1080
Width = 1215
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const Full = 0
Const Locked = 1
Const Trans = 2
'''''''''''''''''''''''''''''''''''''''''''
Const Path = "C:\Program Files\Radmin\radmin.exe"

''''''''''''''Set file transfer view'''''''''''''''
Sub Check1_Click()
ModeNum = Locked
If Check1.Value = 1 Then Check2.Value = 0

End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''
'''''''''''''''Set read only view''''''''''''''''
Sub Check2_Click() 'read only checkbox
ModeNum = Trans
If Check2.Value = 1 Then Check1.Value = 0

End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''
'''''''''''''''''Main Processing'''''''''''''''''''
If Check1.Value = 0 And Check2.Value = 0 Then ModeNum = 0
If KeyAscii = 13 Then

Dim SiteNum
SiteNum = StorNmbr


CmdPart = " /connect:" & SiteNum & " /locolor /updates:10" 'if cmd line changes occur, this will change

If ModeNum = 0 Then
Shell Path & CmdPart, vbNormalFocus
pwwait.Interval = 400

ElseIf ModeNum = 1 Then
Shell Path & CmdPart & " /file", vbNormalFocus 'the switches were not working at first cause they needed a space - fixed that
pwwait.Interval = 400 '2500ms seemed like it was taking forever and I read somewhere that if I was to put 1ms it's actually equal to about 52ms

ElseIf ModeNum = 2 Then
Shell Path & CmdPart & " /noinput", vbNormalFocus
pwwait.Interval = 400

End If
End If


'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''
''''''''''''''''''Timer Function'''''''''''''''''''''
Sub pwwait_Timer()

Dim WScript
Set WScript = CreateObject("Wscript.Shell")
WScript.SendKeys "password"
WScript.SendKeys "{ENTER}" 'after the password was entered it was just sitting there so I put in a ENTER keystroke
pwwait.Interval = 0

End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''
'''''''''''''KeyPresses for Execution of Radmin'''''''''''''''''''''''''
Sub Check1_KeyPress
StorNmbr_KeyPress (KeyAscii)

End Sub

Sub Check2_KeyPress
StorNmbr_KeyPress (KeyAscii)

End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''
'''''''''''''''Ping button'''''''''''''''''''''''''''''''''''
Sub Command1_Click()
Dim SiteNum
SiteNum = StorNmbr
Const CMDPath = "cmd.exe /k ping "
Shell CMDPath & SiteNum & " -l 132 -t", vbNormalFocus
End Sub


whats wrong?...well for all i know there could be a line that says'do not let this script work' and i wouldnt know it


thanks alot

matt

unknown634
02-19-2004, 04:40 PM
Are you trying to use this as just a normal VBS file? Cause this is written based VB6, which would create an EXE if compiled. Naturally, MS doesn't have ANY free VB compilers.

I CAN, however, compile off this code. And I've compiled it already <a target="_blank" href=http://www-personal.umd.umich.edu/~amalenfa/vb>here</a> I also left the source.

Hope that helps,
Unknown

[EDIT] You're missing the top part of the file you needed to compile...so even with Envelop, it wouldn't work. Just so you know.

-----------------
C:\
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN<P ID="edit"><FONT class="small">Edited by unknown634 on 02/19/04 16:43.</FONT></P>

mattmac24
02-19-2004, 08:14 PM
ok the reason i deleted some of it was because it was telling me that some lines were.....wrong....i dunno

so i just deleted them...and as they were mostly like...this is were the .... starts i didnt think itd really matter(and it wasnt working as it was)


yer i cant use the 1 uve compiled because the password on urs is 'password' and i dont wanna change my pw to 'password' also the target file is in the wrong place..mine is c:windows\system32\radmin.exe

that way i can run it by typing radmin in the run box..and also pll wont look there 2 delete it...

i dont wanna take up ur time...so ill just wait till i get vb6 in a few days


thanks alot

matt

unknown634
02-20-2004, 12:55 PM
I wonder why you don't want your password to be 'password'? Maybe just cause too many people use it/images/forums/icons/cool.gif

OK, all sarcasm aside, I added a password prompt and a one-time-only prompt asking you where Radmin.exe is (which I made so you can hit Cancel if it's in the Windows dir or the System dir)

The updated files are in the above link.

Hope that helps,
Unknown

-----------------
C:\
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN

mattmac24
02-20-2004, 05:26 PM
hi, dont worry im not asking for anything else

i just left the feild blank and then later on after entering everything in i get a file not found error

i think the leave blank=win dir dont work...but i can just add it in by changing the directory...where is the file path located? from the source i gather its in the registry.

so all i wan it to change its path

thanks....matt


EDIT: i think that from looking at the source that it checks to c if radmin is there(and if it isnt show a error message)

i dont get that message so...i dunno

if somthing it wrong with the script dont bother changing it....i am getting VB6 in 24 hours!!!...excited so ill just change the default path on one of the previous versions of this script.

matt
<P ID="edit"><FONT class="small">Edited by mattmac24 on 02/20/04 19:45.</FONT></P>