Hello, I am fairly new to using Perl and am having trouble with getting net use to operate correctly. The program will run, but nothing will happen on the target machine.

All of the net use commands and psexec commands work when run in a batch file, so i figure that i have them formatted in-correctly for use in Perl.
#!Perl use 5.010; # Defines variables $ipInput = 0; $userName = 0; $passWord = 0; $ip = 0; # Defines the IP array @ip = (); # User input say "Please enter the username:"; $userName = <STDIN>; say ""; say "Please enter the password:"; $passWord = <STDIN>; say ""; say "Please enter the ip addresses of the machines you would like to i +nstall VNC on"; say ""; say "Ex: xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx etc..."; $ipInput = <STDIN>; # Sets delimeter for array input @ip = split(',',$ipInput); # A loop that will perform the operation on each machine, from wich an + ip was given foreach $ip(@ip) { # Initiate the connection 'net use \\\\$ip\\IPC$ /user:$userName $passWord'; # Copies the program files 'xcopy "C:\\Program Files\\UltraVNC\\*.*" "\\\\$ip\\C$\\Program Files\ +\UltraVNC\\*.*" /r/i/c/h/k/e/Y'; # Dumps the registry 'regedit /e "\\\\$ip\\C$\\vncdmp.txt" "HKEY_LOCAL_MACHINE\\Software\\O +RL"'; # Puts registry entries on remote machine 'psexec \\\\$ip -s -i -d %windir%\\regedit /s C:\\vncdmp.txt'; # Installs the program as a service 'psexec \\\\$ip -s -i -d "C:\\Program Files\\UltraVNC\\winvnc.exe" -in +stall'; # Starts the VNC server 'psexec \\\\$ip -s -i -d net start "VNC Server"'; }
Additionally, I do not know if it matters but I am using Active Perl.
Thank you for your time.

In reply to Trouble with net use by Lobus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.