07-01-2014 03:38 PM
Any suggestions on how to go about that? The problem I run into is that I am opening a command prompt with a command prompt and not sure how to pass the batch file to the secondary command prompt.
07-01-2014 08:55 PM
The system exec should call the batchfile directly.
Something like cmd /c "MyBatchFile.bat"
11-06-2015 12:42 PM
Dear Sir,
Please help me to run command prompt in administrator and have to send a command for example "arp -d 192.168.9.121" programmatically using system execute VI.
Please help me with example.
Regards,
S Nagaraju
11-09-2015 02:18 PM
Hello,
Can you be more specific on the problem you're encountering? Are you receiving an error code?
11-09-2015 10:02 PM
Dear sir,
I am not receiving any errors. Actually we are developing dynamic IP address for one of our customized FPGA board to change IP address for user convenient. Every time user changes to new IP address previous IP should be deleted from the cache memory. For that we have to send one command to command prompt i.e. “arp –d IP address” for example “arp –d 192.168.9.121”. This command will work only administrator command prompt and its send programmatically using system execute.vi and it will work for executables also.
Please help me how to send the command to administrator command prompt.
Regards,
S Nagaraju
11-10-2015 01:41 AM - edited 11-10-2015 01:59 AM
You can do it with a VBS script like this :
you need to fill in your own DOMAIN ADMIN & PASSWORD in below script , (Save below text as 'arp.vbs')
Option explicit Dim oShell set oShell= Wscript.CreateObject("WScript.Shell") oShell.Run "RunAs /user:DOMAIN\ADMIN ""cmd" WScript.Sleep 100 oShell.Sendkeys "PASSWORD" WScript.Sleep 500 REM **** HERE YOU PUT YOUR ARP cmd **** oShell.Sendkeys "arp –d 192.168.9.121~" WScript.Sleep 1000 oShell.Sendkeys "exit~" Wscript.Quit
11-10-2015 02:32 AM
Dear sir,
I don’t have much Knowledge on VBS Scripts.
Can you please implement in LabVIEW.
Regards,
S Nagaraju
11-10-2015 09:18 AM
Well you have to run a VBS script like this,
The file "devmgmt.vbs" contains the text I have posted in previous thread.
The working dir is where your file is located!
Important is that you do not take out the sleeps, they might need some fine tuning... the runas-cmd will launch a 2nd prompt and you need to be sure it's already there before you do your ARP cmd!
good luck!