Win32 Application Packaging #3 [2022] - Copying files to target devices using Intune

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ก.ย. 2024
  • In this video I will show one way to create a folder structure and then copy files into it using a Win32 App from Intune.
    You can use this method to copy new files or to overwrite existing files.
    The .cmd file would be like this
    REM Create Directory
    cmd /c mkdir "C:\Program Files (x86)\DIR-YOU-WANT-TO-CREATE"
    REM Copy files to workstation
    xcopy FILENAME.ANYTHING "\PATH-TO-COPY-FILES-TO\" /y
    xcopy FILENAME.ANYTHING "\PATH-TO-COPY-FILES-TO\" /y
    If you like my content, please Subscribe, like and share
    Thanks for watching

ความคิดเห็น • 45

  • @alhajjaj
    @alhajjaj 10 หลายเดือนก่อน +2

    Hi
    I am trying to do the same steps for copying to replace a file in an existing folder. but it fails with me. if you can help telling me what i am doing wrong.
    here are my steps:
    the CMD was:
    xcopy SAPUILandscape.xml "C:\Users\%userprofile%\AppData\Roaming\SAP\Common" /y
    I package it in win32 app and name it SAP.cmd
    in intune:
    Install command: SAP.cmd
    I ran it a user and as system both failed.
    path: C:\Users\%userprofile%\AppData\Roaming\SAP\Common
    File: SAPUILandscape.xml
    Date Modified as a detection.

  • @voxmnemonic
    @voxmnemonic 2 ปีที่แล้ว +1

    Thank you for this!

    • @Keithdib1
      @Keithdib1  2 ปีที่แล้ว

      Glad it was helpful!

  • @trungtin7719
    @trungtin7719 9 หลายเดือนก่อน +1

    Thank you so much!
    If I copy a zip file, how can I extract it, I tried a powershell command to extract it, but I got the issue.

  • @JamesB-g8j
    @JamesB-g8j ปีที่แล้ว +1

    Hi ScouseFix,
    Thank you for such great video.
    Have been struggling with this for last few months. Any advice will be an immense help. From Intune I'm pushing an application to the client machine in "C:\ProgramData\etc\etc" in System context. It installs the application. After installation I'm with a Intune PSscript trying to copy a file to the client machine "C:\ProgramData\etc\etc" from a network shared location in System context. It installs the application but it isnt copying the file and Intune shows Failed. If I run the PSScript on the client machine as an admin it copies file to the location.
    Script: Copy-Item "C:
    etworkshare\" -Destination "C:\ProgramData\etc\etc"
    Can you let me know if I'm missing something.
    Once again thanks for your efforts.

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว

      Local system account will most likely not have access to your network share

  • @Jdmc8t4
    @Jdmc8t4 4 หลายเดือนก่อน +1

    Hi mate, great video!! but can you help please? i'm following the instructions but no file is populating in the folder when deployed.. Any ideas please?

    • @Keithdib1
      @Keithdib1  3 หลายเดือนก่อน

      Are you running deployment as admin or user?

  • @DonRiyaad
    @DonRiyaad ปีที่แล้ว +1

    What if I want to push an app shortcut to the public desktop map in my company? i've already pushed the app with all it's files and that worked, thanks for that. But I also want the app to open/activate 1 time after succesfully installing so the shortcut appears on the target device, without manually doing anything. I can't make it happen though. My colleague told me it's also possible to make another 'app' for just pushing the shortcut to the public desktop map. so I did exactly the same thing but with only the shortcut-file ofcourse but it fails to install (errorcode 0x80070004). I have no idea what I did wring or is going wrong, I think that I may have made an fault with the detection rules. Do you have any idea on how to solve this?

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว

      Hi, did you assign th shortcut app to run as Administrator or as the User?

  • @abbimaguddayao740
    @abbimaguddayao740 8 วันที่ผ่านมา

    Hi
    I'm trying to deploy a batch file and not run it automatically. I want the batch file to be located at users' desktop and manually execute it by the user. My problem is error said, the application has successfully installed but it is not detected. Can you please help me? Thank you in advance. I tried following your procedure but it didn't work.

    • @Keithdib1
      @Keithdib1  3 วันที่ผ่านมา

      Hi, Do you mean you can see the file in the correct location but Intune says it failed to deploy?

  • @InTheMirrorr
    @InTheMirrorr ปีที่แล้ว +1

    Thank you for all the videos you share.
    I have a question, I have created an app to copy one file .scr to system32 folder on the target machine and the detection is the path and the .scr file .. the cmd file is very simple copy command ... but the installation fails .. what could be wrong? I reviewed everything many times .. I appreciate your suggestions

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว +1

      Hi,
      Are you overwriting an existing file or adding a new file?
      Also can you show the command you are using?

    • @InTheMirrorr
      @InTheMirrorr ปีที่แล้ว

      @@Keithdib1 thanks alot for your reply .. very much appreciated!
      Here is the command:
      xcopy CSSS.scr "C:\Windows\System32" /y
      in the detection I put path: C:\Windows\System32
      and the file is: CSSR.scr
      For one of the machines I saw error: The application was not detected after installation completed successfully (0x87D1041C)
      Is it forbidden to copy to System32 folder?

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว +1

      Try
      xcopy "%~dp0CSSS.scr" "C:\Windows\System32" /y
      and run this as administrator not user
      the .scr file needs to be in the same folder as the .cmd file, not in a sub folder

  • @jordankennedy6759
    @jordankennedy6759 หลายเดือนก่อน

    I am trying to copy to the public desktop (so it should appear for all users). I am doing a system install.
    I have tried using cmd and powershell and getting file not found error in event viewer.
    There is no folder structure in my win32 package.
    In Powershell:
    $sourcePath = "$scriptPath\FileName.extension" # Path to your file
    $destinationPath = "C:\Users\Public\Desktop\FileName.extension" # Public desktop path
    Copy-Item -Path $sourcePath -Destination $destinationPath -Force
    And using the cmd File:
    xcopy FileName.extension "C:\Users\Public\Desktop\" /y

    • @Keithdib1
      @Keithdib1  14 วันที่ผ่านมา

      Hi
      I woud try a line like this "xcopy FILENAME.ANYTHING "\PATH-TO-COPY-FILES-TO\" /y" rather than using the $ScriptPath to see if this works

  • @Khan613
    @Khan613 ปีที่แล้ว

    Why is a setup file required? I just want to deploy the files into a folder on the target device.
    For example. I want to dump a portable utility to C:\PortableApp
    What do I use for the question 2: Setup file. There is no setup as such.
    Will the "output folder" be C:\PortableApp ?

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว

      You can just copy files to a target path, if you don't need a setup file then you won't have one to copy

  • @trpcltek
    @trpcltek ปีที่แล้ว

    Just to clarify this procedure, you are running a script that will copy a file on the local hard drive or network drive and move it to the target location on a computer?

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว +1

      no, the file is copied from within the win32 package to a location on the local device. You could easily copy from a network location assuming the device/user had access to the share and the device was connected to the network etc

    • @trpcltek
      @trpcltek ปีที่แล้ว +1

      Awesome this is what I’m looking for. Tested it and it works. Thanks

  • @user-zr3jy1pu1g
    @user-zr3jy1pu1g ปีที่แล้ว

    Hi, Im trying to copy pdf file using your CMD command: xcopy Stamp.pdf "C:\Users\%USERNAME%\AppData\Roaming\Adobe\Acrobat\DC\Stamps" /y. Its not copying the pdf to Stamps folder? Am I doing anything wrong? For the Intune Install behavior I select User and OS architecture: x86 and x64. Please advice?

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว

      Does the folder structure exists at the time your trying to copy across?
      is the .pdf file in the (effective) root of the .intunewin?

  • @PJBhm
    @PJBhm 2 หลายเดือนก่อน

    Hello, how can I push an existing file to a specific folder on my remote laptop using Intune ? In your demo, you do not select any file you just select a cmd script. Thanks !

    • @Keithdib1
      @Keithdib1  2 หลายเดือนก่อน

      Just add any file to the script to copy it across

    • @PJBhm
      @PJBhm 2 หลายเดือนก่อน

      Ok ! And how the script will know the source path of the file ?
      Thanks !

    • @Keithdib1
      @Keithdib1  2 หลายเดือนก่อน

      As long as the files are in the root of the intunewim file, that is the source path, and destination path is in the script "xcopy FILENAME.ANYTHING "\PATH-TO-COPY-FILES-TO\" /y"

    • @PJBhm
      @PJBhm 2 หลายเดือนก่อน

      Thanks ! The best practice would be to store the folder with the files and the intunewin somewhere in a folder on our sever rather than on the desktop on which I work. I am right ?

    • @Keithdib1
      @Keithdib1  2 หลายเดือนก่อน

      You should store all source files in a safe place, that others have access to so its available for future use

  • @hirengandhi12
    @hirengandhi12 ปีที่แล้ว

    How do I replace a file? I need to replace a default word file Normal.dotm with the one that I created. Replace path is C:\Users\%Username%\AppData\Roaming\Microsoft\Templates

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว

      You may need to run the copy command as the logged on user, do you have a script you have already tried?

  • @OmarMa-ur8jt
    @OmarMa-ur8jt ปีที่แล้ว

    Thank you for your video
    I followed your steps, but in the end I got the message of failure.
    I wish I could deploy a cmd file to this path:C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
    Do you have any advice for me
    Thanks again!

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว

      Are you running the Win32 as USER or as ADMINISTRATOR?

    • @OmarMa-ur8jt
      @OmarMa-ur8jt ปีที่แล้ว

      @@Keithdib1 Thank you for your reply
      I use administrator to run when packing files.
      Or did I get something wrong?

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว

      Its the same as 'run As' so it will try to copy those files to the Administrator account, not the logged on user account. If you need to copy files to the logged on users "AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" create a win32 just for the file copy to that location and run as the user

    • @OmarMa-ur8jt
      @OmarMa-ur8jt ปีที่แล้ว

      @@Keithdib1 If I don't open Win32 with administrator, Win32 can't package the file.
      But I tried to pack the file with a local account and without Run as administrator, I was able to pack the file successfully, but when I sent the file, it still showed failure on the user device.

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว

      Hi, I didn't mean package the file as a user, I mean run the win32 package on the target device in Intune as a user

  • @aranbillen5954
    @aranbillen5954 2 ปีที่แล้ว

    Hi! How do I copy a folder containing files to a users own documents area?

    • @Keithdib1
      @Keithdib1  2 ปีที่แล้ว

      Hi, a share would make more sense, but what is the scenario?

    • @bkg_parzival6484
      @bkg_parzival6484 2 ปีที่แล้ว

      Probably wanna do
      cmd /c "Path of file you wanna copy here"
      REM Copy files to workstation
      xcopy FILENAME.ANYTHING "C:\\Users\(Username here)\Documents" /y
      Or something to that effect. Would have to be done as admin for user permission sake to write to that folder if Im not mistaken

    • @rupeshsrivastava132
      @rupeshsrivastava132 ปีที่แล้ว

      Getting error code 0x800700C1. While trying to copy file from intune to client machine

    • @Keithdib1
      @Keithdib1  ปีที่แล้ว

      What syntax are you using?