I migrated a batch job from Windows Server 2012 to a Windows Server 2019 VM. It worked on the legacy server but not working on the newly setup virtual machine for some reason...I'm trying to automate the move of all files from a shared network drive locally to the server. The service account that's used to trigger this job via Task Scheduler has full permissions to that location.
move /y "\\example.com\europe\Department\EN\Shared Folder\*" "C:\Temp\QUANTITIES"
Any ideas why? The batch job simply gets stuck executing even when I run it with my own a-account.
Related
I do have a (server) Windows machine running a Java app and a DB. The Java app has an UI and it is wrapped in an .exe. Now I share the .exe's folder with client machines. From such client machines I click the .exe, where does the program run? If it is running on the remote machine how can it be that I see the UI on my machine? What's happen when many client users click on the .exe contemporarly?
ok, I think it gets executed on the client/local machine (local copy).
I am running an Azure Windows VM which runs a batch file when it starts (its started from Task Scheduler).
The batch file cannot be started as SYSTEM and needs to be run as a user, so I use the VM administrator. In Task Scheduler this user shows as \. This all works fine.
My question is though - I want to be able to run many of these VMs by making a VHD of the existing VM then creating more VMs (perhaps in a ScaleSet) from that VHD.
The script needs to be run when the VM is first started AND if it is ever rebooted.
I assume though that when I do this, my start-up script will break as the MACHINE_NAME will be different for each VM.
What is a good solution for this problem?
if it started from task schedular and is a batch job, you can move it to webjobs too and schedule there. and then create as many webjobs to want of the same batch file. no need to create and maintain VMs
Would like to create a pack for windows 2008 Server (hopefully compatible with Windows 2003 Server). Basically a windows powershell script which should perform below tasks in command line. Idea is to provide this script to a Windows Sys Admin to execute this script on target windows server.
Create a windows Inbound Firewall rule to allow port 22 from any host.
Create a bunch of directories and set ownership to a service account (e.g username = deployuser from Active Directory) by reading a comma separated property value “directoryToCreate” (e.g directoryToCreate=”c:/temp,c:/temp/stage,c:/temp/cache,c:/temp/src”
Execute an EXE which will create a windows service
Verify Step 3 windows service has been created and STARTED and RUNNING fine.
5 Final report showing on all above activities.
e.g directories created successfully
Inbound Rule created successfully
Exe execution and Windows Service verified successfully
Since I have to perform this pack on 30+ Servers, Any suggestion/advise on the best practice please?
Is powershell good enough?
Can I create and EXE Installer on top of powershell?
etc
Thanks in advance
I have written a Excel VB to save a file to sharepoint from an automated task. It works fine if it is connected to office network. If I am offline , I save the file to local drive . Can somebody help me with a macro to save the file to server when computer is connected to office network? My office does not recommend checking the network status continuously. Any suggestions will be appreciated
By automated task do you mean a Scheduled Task?
If so and you happen to be running on Windows 7, you can set Scheduled Tasks to only run if certain network conditions are met. You could build a separate macro that takes any files stored locally and pushes them up to the server and have that macro run only when the network is connected.
Currently, I want a remote machine (Amazon EC2 instance) to run a batch file when the machine starts up, and the batch file will close the machine after finishing the tasks.
I tried to put the shortcut of batch file to the startup folder. However, it will be only ran when I use Remote Control Connection to Log in that machine.
So, any other way to solve this problem???
NOTE: I don't want to log in to that machine since there might be 10 remote machines running at the same time.
Any idea or thought is appreciated. Thanks a lot.
This looks a bit like the question Running Batch File in background when windows boots up, my answer there:
You can use autoexnt for this. It was original designed for windows NT, but is still working in newer versions of windows.
You have to download the Windows 2003 Resource Kit to get it.
Windows XP (I believe Vista and 7 its the same as well, not sure about NT/2000)
Run gpedit.msc
Local Computer Policy -> Computer Configuration -> Windows Settings -> Scripts (Startup/Shutdown)
Open Startup. Click Add... Script Name: is where you input or Browse the location of your batch script to run. Script Parameters you can leave blank if you have no additional parameters you wish to pass w/it.