Hello,
is it possible to run a batch or PowerShell file from within WAPT?
Thank you in advance.
[SOLVED] Run a batch or powershell script
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
batch:
run("install.bat")
run("install.bat")
Hello,
I'm a beginner in Python and I'm currently learning.
I've managed to run my batch file, but I'd like to know if it's possible to display the batch file window on the computer to follow its progress?
Thank you.
I'm a beginner in Python and I'm currently learning.
I've managed to run my batch file, but I'd like to know if it's possible to display the batch file window on the computer to follow its progress?
Thank you.
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
- Challans Town Hall
- Messages: 15
- Registered: July 7, 2014 - 3:52 PM
Hello,
the only way to see the progress is to open a command prompt as administrator and type `wapt-get install`.
Alternatively, put as many print statements as possible in the Python file and see the result of an installation in the WAPT console.
the only way to see the progress is to open a command prompt as administrator and type `wapt-get install`.
Alternatively, put as many print statements as possible in the Python file and see the result of an installation in the WAPT console.
Good morning,
Can you provide more details on how to launch a Batch script via WAPT?
I have my script but I don't know how to insert it into the console to apply it to certain workstations.
THANKS.
Hi Chris,
Batch files are not MSI files and run differently. You can't drag and drop a batch file to turn it into a WAPT package. To create a package that runs a *.bat script, see the documentation on creating a package for portable software: https://www.wapt.fr/fr/doc/CreationPaqu ... -avec-wapt
Regards,
Alexandre
Batch files are not MSI files and run differently. You can't drag and drop a batch file to turn it into a WAPT package. To create a package that runs a *.bat script, see the documentation on creating a package for portable software: https://www.wapt.fr/fr/doc/CreationPaqu ... -avec-wapt
Regards,
Alexandre
I see I'm not the only one stuck on this. Originally, I wanted to simply copy and paste the contents of a directory onto my users' desktops. I ended up creating a .bat file, converting it to .exe, which was then converted to .wapt (a real mess). The result is an error message, even though the package itself seems to work correctly.
Is there a simple method to just deploy a .bat file?
setup.py
status error code:
Is there a simple method to just deploy a .bat file?
setup.py
Code: Select all
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
def install():
print('installing 974-mo_raccourci')
install_exe_if_needed("MO_raccourci.exe",'/VERYSILENT',key='',min_version='0.0.0')
Code: Select all
installing 974-mo_raccourciTraceback (most recent call last):
File "C:\Program Files (x86)\wapt\common.py", line 3683, in install_wapt
exitstatus = setup.install()
File "c:\windows\temp\wapt2qcibk\setup.py", line 8, in install
File "C:\Program Files (x86)\wapt\common.py", line 3642, in new_func
return func(*args,**kwargs)
File "C:\Program Files (x86)\wapt\setuphelpers.py", line 4192, in install_exe_if_needed
run(r'"%s" %s' % (exe,silentflags),accept_returncodes=accept_returncodes,timeout=timeout,pidlist=pidlist)
File "C:\Program Files (x86)\wapt\setuphelpers.py", line 1058, in run
raise CalledProcessErrorOutput(proc.returncode,cmd,''.join(output))
CalledProcessErrorOutput: Command '"MO_raccourci.exe" /VERYSILENT' returned non-zero exit status 2.
Output:
c:\windows\temp\wapt2qcibk>robocopy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Bureautique" "C:\Users\Public\Desktop"
-------------------------------------------------------------------------------
ROBOCOPY :: Copie de fichiers robuste pour Windows
-------------------------------------------------------------------------------
Début : Thu Apr 04 09:02:01 2019
Source : C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Bureautique\
Dest : C:\Users\Public\Desktop\
Fichiers : *.*
Options : *.* /COPY:DAT /R:1000000 /W:30Good morning,
I'm in the same boat as you. I can deploy my .bat file via Wapt. It deploys successfully on my client machines, but Wapt still returns an error...
My script is as follows:
I'm in the same boat as you. I can deploy my .bat file via Wapt. It deploys successfully on my client machines, but Wapt still returns an error...
My script is as follows:
Code: Select all
def session_setup():
run(r'script.bat');