• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

CMD or Batch snapins are not working! I have no more idea.

Scheduled Pinned Locked Moved Solved
General
6
24
14.6k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ?
    A Former User @Tom Elliott
    last edited by A Former User Jan 14, 2016, 4:42 AM Jan 14, 2016, 10:42 AM

    @Tom-Elliott

    yes, the VM_classroom Folder does already exist. So I don’t have to make the folder with the script.

    1 Reply Last reply Reply Quote 0
    • ?
      A Former User @Tom Elliott
      last edited by Jan 14, 2016, 10:45 AM

      @Tom-Elliott
      We make different learning course and not everyone needs a VM. For this reason, we want the batch script as snapin. Thats the easiest way for us I think.

      1 Reply Last reply Reply Quote 0
      • ?
        A Former User @Tom Elliott
        last edited by Jan 14, 2016, 11:50 AM

        @Tom-Elliott

        I have another script in the startup folder, which mounts the Z: drive after a (re-)boot.

        1 Reply Last reply Reply Quote 0
        • J
          jbsclm Developer
          last edited by jbsclm Jan 14, 2016, 6:10 AM Jan 14, 2016, 12:06 PM

          There are a couple of thing to understand about mapped drives and processes running as the system account.

          1. A mapped drive only exists in the process which maps it, so mapping it a startup script will not make it available to later processes. You need to always refer to the share by its UNC path.
          2. You will need to ensure that the share you are trying to access has read and execute permission set for “domain computers” , the client system account belongs to this group.
          1 Reply Last reply Reply Quote 1
          • W
            Wayne Workman @A Former User
            last edited by Wayne Workman Jan 14, 2016, 7:33 AM Jan 14, 2016, 1:32 PM

            @Reto said:

            14.01.2016 10:01 FOG::SnapinClient Installation returned with code: 1

            1 means it error’d out.

            You need output recording to figure out what’s wrong…

            @echo off
            xcopy "\\172.16.224.177\Public\VM_Classroom\*.*" "%SystemDrive%\Users\TEC\Desktop\VM_Classroom" /y /d /e /c /i /f /h /k /v /s >> %temp%\vm_copy_output.log
            IF ERRORLEVEL 1 GOTO failed
            echo VM successfully copied. >> %temp%\vm_copy_output.log
            goto startvm
            :failed
              echo Error. >> %temp%\vm_copy_output.log
            goto end
            pause
            :startvm
            cd "C:\Users\TEC\Desktop\VM" >> %temp%\vm_copy_output.log
            for /f "delims=" %%a in ('dir /b/s') do if /i "%%~xa"==".vmx" start %%a
              timeout /t 15 >> %temp%\vm_copy_output.log
            taskkill /F /IM vmware.exe >> %temp%\vm_copy_output.log
            :end
            
            

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
            Daily Clean Installation Results:
            https://fogtesting.fogproject.us/
            FOG Reporting:
            https://fog-external-reporting-results.fogproject.us/

            J 1 Reply Last reply Jan 14, 2016, 1:46 PM Reply Quote 0
            • J
              jbsclm Developer @Wayne Workman
              last edited by Jan 14, 2016, 1:46 PM

              @Wayne-Workman another thing to be aware of is that when you run as the system account, you won’t get the full environment that a normal process would get. It would be better to state a local path in full, rather than rely on environment variables, particularly in the case of %temp%

              W 1 Reply Last reply Jan 14, 2016, 1:52 PM Reply Quote 1
              • W
                Wayne Workman @jbsclm
                last edited by Jan 14, 2016, 1:52 PM

                @jbsclm Noted.

                @reto set the output path to whatever you need. I changed it to C:\vm_copy_output.log Here at work, I have my output redirected to hidden read/write network shares, and I name the files with the %computername% variable usually.

                @echo off
                xcopy "\\172.16.224.177\Public\VM_Classroom\*.*" "%SystemDrive%\Users\TEC\Desktop\VM_Classroom" /y /d /e /c /i /f /h /k /v /s >> c:\vm_copy_output.log
                IF ERRORLEVEL 1 GOTO failed
                echo VM successfully copied. >> c:\vm_copy_output.log
                goto startvm
                :failed
                  echo Error. >> c:\vm_copy_output.log
                goto end
                pause
                :startvm
                cd "C:\Users\TEC\Desktop\VM" >> c:\vm_copy_output.log
                for /f "delims=" %%a in ('dir /b/s') do if /i "%%~xa"==".vmx" start %%a
                  timeout /t 15 >> c:\vm_copy_output.log
                taskkill /F /IM vmware.exe >> c:\vm_copy_output.log
                :end
                

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                Daily Clean Installation Results:
                https://fogtesting.fogproject.us/
                FOG Reporting:
                https://fog-external-reporting-results.fogproject.us/

                ? 1 Reply Last reply Jan 14, 2016, 2:39 PM Reply Quote 0
                • ?
                  A Former User @Wayne Workman
                  last edited by Jan 14, 2016, 2:39 PM

                  @Wayne-Workman Thank you a lot! 👍

                  I can deploy your batch file successfully. And the log file is also created under 😄 Drive
                  I used “😄 \ windows \ system32 \ cmd.exe” and argument “C /”.

                  All files from the public share are now on my desktop in the folder VM_Classroom.

                  But unfortunately the VM does not start. It only copies the files.

                  These are the last few lines of the log file:

                  \172.16.224.177\Public\VM_Classroom\10500_VM1_BIv4_BigData\caches\GuestAppsCache\launchMenu\version -> C:\Users\TEC\Desktop\VM\10500_VM1_BIv4_BigData\caches\GuestAppsCache\launchMenu\version
                  173 File(s) copied
                  VM successfully copied.

                  Waiting for 15 seconds, press a key to continue …14  13  12  11  10  9  8  7  6  5  4  3  2  1  0
                  SUCCESS: The process “vmware.exe” with PID 4960 has been terminated.

                  It looks like the script skips the step where it should go to the VM.

                  hmmm do you see maybe an other mistake?

                  W 1 Reply Last reply Jan 14, 2016, 2:46 PM Reply Quote 0
                  • W
                    Wayne Workman @A Former User
                    last edited by Jan 14, 2016, 2:46 PM

                    @Reto I’m not sure about that… That’s all specific to your site and I have zero experience doing what you’re doing specifically.

                    Best I can tell you is to use the output redirection to your advantage, and test your commands manually. Surely it can be done - but past this I can’t really help.

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                    Daily Clean Installation Results:
                    https://fogtesting.fogproject.us/
                    FOG Reporting:
                    https://fog-external-reporting-results.fogproject.us/

                    ? 1 Reply Last reply Jan 14, 2016, 2:50 PM Reply Quote 0
                    • ?
                      A Former User @Wayne Workman
                      last edited by Jan 14, 2016, 2:50 PM

                      @Wayne-Workman

                      All right. Thank you very much for the help! 👍
                      I saw that when I run the file locally, it copies and starts the VM as it should.
                      I have to find out why that its not work when I’m using snapins.

                      1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User
                        last edited by Jan 19, 2016, 3:56 PM

                        Hey guys its me again,

                        I guess I could track down the problem.

                        The batch file copies all files from the server (172.16.224.177) to the VM_Classroom folder. But when the batch file should open the VM, a new window of “Interactive Services Detection” starts instead.
                        When I press “View the Message”, I see the VMware interface, which opens the VM. And after 15 seconds, the window closes again, just like it says in the batch file.

                        Thus, I can say that the batch file works, but the VM is launched in Windows interactive service. When I close the window, the VM is not running in the VMware SW.

                        How can I solve this problem?

                        W 1 Reply Last reply Jan 19, 2016, 4:15 PM Reply Quote 0
                        • W
                          Wayne Workman @A Former User
                          last edited by Jan 19, 2016, 4:15 PM

                          @Reto Fog snapins must run silently. This is because they could run while the computer is not logged in, while it’s logged in but locked, overnight, etc. There can be no visual output attempted from a snapin. You need to figure out how to make your script totally silent - and that might mean using a different method in the script. Don’t think about making it work as it is now, think about what is acceptable and what can work.

                          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                          Daily Clean Installation Results:
                          https://fogtesting.fogproject.us/
                          FOG Reporting:
                          https://fog-external-reporting-results.fogproject.us/

                          1 Reply Last reply Reply Quote 0
                          • ?
                            A Former User
                            last edited by Jan 19, 2016, 4:24 PM

                            @Wayne-Workman Thank you! I will try to convert the batch to an .exe file.

                            1 Reply Last reply Reply Quote 0
                            • 1
                            • 2
                            • 2 / 2
                            2 / 2
                            • First post
                              21/24
                              Last post

                            252

                            Online

                            12.1k

                            Users

                            17.3k

                            Topics

                            155.3k

                            Posts
                            Copyright © 2012-2024 FOG Project