Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Shell

    Salve a tutti sono nuovo e mi serve il vostro aiuto.

    Prima di tutto vi spiego il mio problema. Devo scrivere uno script che apre un eseguibile sul computer nel quale viene eseguito, quindi aprire una shell di dos e scrivere la directory.

    in php non è difficile c'è la funzione shell_exec('cmd')

    in javascript esiste una cosa simile?
    o se non esiste oltre al php c'è un linguaggio che permette di farlo?

  2. #2
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    No quello che chiedi non è possibile (per fortuna) da js, per avere qualcosa di cross-browser si dovrebbe creare un programmino con c++ visual-basic .net da installare sul pc fose anche (applet)java.
    Fai una ricerca sui forum programmazione o chiedi ad un Mod di quella sezione, poi al limite ti fai spostare la discussione.


    P.S. Non sono esperto i programmi citati potrebbero non andare bene.
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  3. #3
    perchè il mio intento era di far andare l'eseguibile di skype in modo che si aprisse, e poi in un secondo momento di far partire questo script.

    '// Create a Skype4COM object:
    Set oSkype = WScript.CreateObject("Skype4COM.Skype", "Skype_")

    '// Start the Skype client:
    If Not oSkype.Client.IsRunning Then oSkype.Client.Start() End If

    '// Declare the following Skype constants:
    cUserStatus_Offline = oSkype.Convert.TextToUserStatus("OFFLINE")
    cUserStatus_Online = oSkype.Convert.TextToUserStatus("ONLINE")
    cCallStatus_Ringing = oSkype.Convert.TextToCallStatus("RINGING")
    cCallStatus_Inprogress = oSkype.Convert.TextToCallStatus("INPROGRESS")
    cCallStatus_Failed = oSkype.Convert.TextToCallStatus("FAILED")
    cCallStatus_Refused = oSkype.Convert.TextToCallStatus("REFUSED")
    cCallStatus_Cancelled = oSkype.Convert.TextToCallStatus("CANCELLED")
    cCallStatus_Finished = oSkype.Convert.TextToCallStatus("FINISHED")
    cCallStatus_Busy = oSkype.Convert.TextToCallStatus("BUSY")
    cAttachmentStatus_Available = oSkype.Convert.TextToAttachmentStatus("AVAILABLE")

    '// The PlaceCall command will fail if the user is offline. To avoid failure, check user status and change to online if necessary:
    If cUserStatus_Offline = oSkype.CurrentUserStatus Then oSkype.ChangeUserStatus(cUserStatus_Online) End If

    '// Create a user object:
    Set oUser = oSkype.User("echo123")
    '// WScript.Echo "User " & oUser.Handle & " online status is " & oSkype.Convert.OnlineStatusToText(oUser.OnlineStat us)

    '// Place a call:
    Set oCall = oSkype.PlaceCall(oUser.Handle)

    '// Wait until the call is in progress and return the relevant error if any other status occurs:
    Do While oCall.Status <> cCallStatus_Inprogress
    If oCall.Status = cCallStatus_Failed Or _
    oCall.Status = cCallStatus_Refused Or _
    oCall.Status = cCallStatus_Cancelled Or _
    oCall.Status = cCallStatus_Finished Or _
    oCall.Status = cCallStatus_Busy Then
    Err.Raise vbObjectError + 1, "", "Call status: " & oSkype.Convert.CallStatusToText(oCall.Status)
    End If
    WScript.Sleep(500)
    Loop

    '// Check sending DTMF tones for use with interactive voice response (IVR) applications:
    WScript.Sleep(10000)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "0" End If
    WScript.Sleep(500)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "1" End If
    WScript.Sleep(500)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "2" End If
    WScript.Sleep(500)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "3" End If
    WScript.Sleep(500)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "4" End If
    WScript.Sleep(500)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "5" End If
    WScript.Sleep(500)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "6" End If
    WScript.Sleep(500)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "7" End If
    WScript.Sleep(500)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "8" End If
    WScript.Sleep(500)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "9" End If
    WScript.Sleep(500)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "#" End If
    WScript.Sleep(500)
    If cCallStatus_InProgress = oCall.Status Then oCall.DTMF = "*" End If
    WScript.Sleep(500)

    '// Finish the call:
    If oCall.Status <> cCallStatus_Finished Then oCall.Finish() End If

    '// The AttachmentStatus event handler monitors attachment status and automatically attempts to reattach to the API following loss of connection:
    Public Sub Skype_AttachmentStatus(ByVal aStatus)
    '// WScript.Echo ">Attachment status " & oSkype.Convert.AttachmentStatusToText(aStatus)
    If aStatus = cAttachmentStatus_Available Then oSkype.Attach() End If
    End Sub

    '// If the call status is "failed", the CallStatus event handler returns the relevant failure reason as text:
    Public Sub Skype_CallStatus(ByRef aCall, ByVal aStatus)
    '// WScript.Echo ">Call " & aCall.Id & " status " & aStatus & " " & oSkype.Convert.CallStatusToText(aStatus)
    If cCallStatus_Failed = aStatus Then
    '// WScript.Echo ">Failure reason:" & oSkype.Convert.CallFailureReasonToText(aCall.Failu reReason)
    End If
    End Sub

    è uno script in vbs che avevo trovato su skype per utilizzare le API del programma....ma se non funziona nessuno dei due mi tocca di fare un programmino....dannazzione...

    vabbè se avete altri suggerimenti sono ben accetti. Cmq grazie per la risposta

  4. #4
    Ma questo script deve essere eseguito all'interno di una pagina HTML o come script standalone?
    Amaro C++, il gusto pieno dell'undefined behavior.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.