Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: What am i doing wrong?  (Read 3979 times)

0 Members and 1 Guest are viewing this topic.

Arotin

    Topic Starter


    Rookie

    • Experience: Beginner
    • OS: Windows 7
    What am i doing wrong?
    « on: January 06, 2016, 06:41:20 PM »
    Hello,

    here is my script (confidential info changed .. obviously):



    setlocal enabledelayedexpansion
    set Citpath=C:\Program Files (x86)\Citrix\ICA Client\SelfServicePlugin\CleanUp.exe

    for /F %%F in (pclist.txt) do (

    echo Connecting to %%F  ...
    NET USE w: \\$$F\c$ PASSWORD /USER:Administrator
    xcopy CitrixReceiver.exe w:
    timeout /t 5
    psexec \\%%F c:\CitrixReceiver.exe /silent /accepteula /STORE0="store;https://test.test.com/Citrix/pnagent/config.xml;on;TEST"
    IF !errorlevel! EQU 0 psexec.exe \\%%F !Citpath! /CleanUser /silent
    echo Complete
    NET USE w: /delete
    )

    pause


    - The problem i have having is, it would at first just close on its own, until i put that variable as the path, now it says "network connection could not be found"
    i can ping the other machine, both on same network. is there anything wrong with my batch script here that im not seeing?



    thanks in advance.


    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: What am i doing wrong?
    « Reply #1 on: January 07, 2016, 05:15:13 PM »
    This is the right place to get help.
    Myself, I can not do it because your code is too hard to read. It looks link you put a space in a place where is should not be.
    Next time you put code in your post, please use  the CODE marker, the box with the # inside. That way  others can copy and test your code.

    Also, make the code simple and modular. And include comments that explain what is going to happen. Also, provide a short set of input arguments (parameters) for testing. This lets  others test your code without damage to their own machines or network.

    Best I can offer. But try again n and somebody else will see what your want.


    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: What am i doing wrong?
    « Reply #2 on: January 07, 2016, 07:29:29 PM »
    $$F should be %%F

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: What am i doing wrong?
    « Reply #3 on: January 09, 2016, 11:03:27 PM »
    is there anything wrong with my batch script here that im not seeing?
    $$F should be %%F
    Arotin, was this advice helpful to you?

    Arotin

      Topic Starter


      Rookie

      • Experience: Beginner
      • OS: Windows 7
      Re: What am i doing wrong?
      « Reply #4 on: January 29, 2016, 03:34:28 PM »
      This is the right place to get help.
      Myself, I can not do it because your code is too hard to read. It looks link you put a space in a place where is should not be.
      Next time you put code in your post, please use  the CODE marker, the box with the # inside. That way  others can copy and test your code.

      Also, make the code simple and modular. And include comments that explain what is going to happen. Also, provide a short set of input arguments (parameters) for testing. This lets  others test your code without damage to their own machines or network.

      Best I can offer. But try again n and somebody else will see what your want.



      Lol what? how is that hard to read....but thank you for the advice i will take it.

      Arotin, was this advice helpful to you?


      that was my typo on here, the code was correct.. that was not the issue. thank you..

      Squashman



        Specialist
      • Thanked: 134
      • Experience: Experienced
      • OS: Other
      Re: What am i doing wrong?
      « Reply #5 on: January 29, 2016, 04:39:58 PM »


      that was my typo on here, the code was correct.. that was not the issue. thank you..
      Umm. Have you ever heard of copy and paste? Zero chance of error!

      Repost all your code inside code tags, and maybe we can still help you. Use copy and paste this time.

      Arotin

        Topic Starter


        Rookie

        • Experience: Beginner
        • OS: Windows 7
        Re: What am i doing wrong?
        « Reply #6 on: January 29, 2016, 05:01:44 PM »
        Umm. Have you ever heard of copy and paste? Zero chance of error!

        Repost all your code inside code tags, and maybe we can still help you. Use copy and paste this time.


        Will do in the future, i apologize for my typo. thanks. i ended up doing this manually one by one (installing receiver and configuring it). if i figure it out i will post the result here for all to see.


        thanks.

        Squashman



          Specialist
        • Thanked: 134
        • Experience: Experienced
        • OS: Other
        Re: What am i doing wrong?
        « Reply #7 on: January 29, 2016, 11:49:28 PM »
        If you execute the NET USE command by itself from a cmd prompt does it successfully map the drive?
        Also your CITPATH variable has spaces in it. You need to quote file paths that have spaces in them.

        Also not understanding why you are mapping a drive letter to the administrative share and then using xcopy to copy the file over to the remote computer.  PSEXEC can do that all in one shot!  You never needed to map a drive letter to the remote computer.